diff --git a/Gemfile b/Gemfile index 8fd03a16..1c386aad 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,9 @@ gem 'rails', '3.2.17' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' +gem 'watir' +gem 'phantomjs' + gem 'devise' gem 'redis', '2.2.2' gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index b4efab8d..a8354dc6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -39,6 +39,8 @@ GEM rails (~> 3.1) builder (3.0.4) cancan (1.6.10) + childprocess (0.5.3) + ffi (~> 1.0, >= 1.0.11) climate_control (0.0.3) activesupport (>= 3.0) cocaine (0.5.4) @@ -50,6 +52,7 @@ GEM coffee-script-source execjs coffee-script-source (1.7.0) + commonwatir (4.0.0) devise (3.2.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -58,6 +61,8 @@ GEM warden (~> 1.2.3) erubis (2.7.0) execjs (2.0.2) + ffi (1.9.0) + ffi (1.9.0-x86-mingw32) formtastic (2.2.1) actionpack (>= 3.0) formula (1.0.1) @@ -75,6 +80,8 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.25.1) + mini_magick (3.5.0) + subexec (~> 0.2.1) mini_portile (0.6.0) multi_json (1.10.0) nokogiri (1.6.2.1) @@ -89,6 +96,7 @@ GEM mime-types pg (0.17.1) pg (0.17.1-x86-mingw32) + phantomjs (1.9.7.1) polyglot (0.3.4) rack (1.4.5) rack-cache (1.2) @@ -115,19 +123,28 @@ GEM rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rake (10.3.2) + rautomation (0.15.0) + ffi (= 1.9.0) rdoc (3.12.2) json (~> 1.4) redis (2.2.2) + rubyzip (1.1.6) sass (3.3.7) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) + selenium-webdriver (2.42.0) + childprocess (>= 0.5.0) + multi_json (~> 1.0) + rubyzip (~> 1.0) + websocket (~> 1.0.4) sprockets (2.2.2) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) + subexec (0.2.3) thor (0.19.1) thread_safe (0.3.3) tilt (1.4.1) @@ -140,6 +157,36 @@ GEM json (>= 1.8.0) warden (1.2.3) rack (>= 1.0) + watir (5.0.0) + commonwatir (~> 4) + watir-webdriver + watir (5.0.0-x86-mingw32) + commonwatir (~> 4) + watir-classic (~> 4.0) + watir-webdriver + watir-classic (4.0.1) + ffi (~> 1.0) + multi_json + nokogiri (>= 1.5.7.rc3) + rautomation (~> 0.7) + win32-process (>= 0.5.5) + win32screenshot (~> 1.0.9) + windows-pr (>= 0.6.6) + watir-webdriver (0.6.10) + selenium-webdriver (>= 2.18.0) + websocket (1.0.7) + win32-api (1.5.1-x86-mingw32) + win32-process (0.7.4) + ffi (>= 1.0.0) + win32screenshot (1.0.10) + ffi (~> 1.0) + mini_magick (~> 3.5.0) + rautomation (~> 0.7) + windows-api (0.4.2) + win32-api (>= 1.4.5) + windows-pr (1.2.3) + win32-api (>= 1.4.5) + windows-api (>= 0.4.0) PLATFORMS ruby @@ -158,8 +205,10 @@ DEPENDENCIES json paperclip pg + phantomjs rails (= 3.2.17) rails3-jquery-autocomplete redis (= 2.2.2) sass-rails uglifier (>= 1.0.3) + watir diff --git a/app/assets/javascripts/metamaps/Metamaps.Backbone.js b/app/assets/javascripts/metamaps/Metamaps.Backbone.js index f322ef9f..aabfe4ce 100644 --- a/app/assets/javascripts/metamaps/Metamaps.Backbone.js +++ b/app/assets/javascripts/metamaps/Metamaps.Backbone.js @@ -1,7 +1,7 @@ Metamaps.Backbone = {}; Metamaps.Backbone.Map = Backbone.Model.extend({ urlRoot: '/maps', - blacklist: ['created_at', 'updated_at', 'user_name', 'topic_count', 'synapse_count', 'topics', 'synapses', 'mappings', 'mappers'], + blacklist: ['created_at', 'updated_at', 'user_name', 'contributor_count', 'topic_count', 'synapse_count', 'topics', 'synapses', 'mappings', 'mappers'], toJSON: function (options) { return _.omit(this.attributes, this.blacklist); }, @@ -53,16 +53,21 @@ Metamaps.Backbone.Map = Backbone.Model.extend({ return this.get('mappers'); }, attrForCards: function () { + function capitalize(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + } var obj = { id: this.id, name: this.get('name'), desc: this.get('desc'), - username: this.get('user_name'), - mkPermission: this.get("permission") ? this.get("permission").substring(0, 2) : "co", + permission: this.get("permission") ? capitalize(this.get("permission")) : "Commons", editPermission: this.authorizeToEdit(Metamaps.Active.Mapper) ? 'canEdit' : 'cannotEdit', - topicCount: this.get('topic_count'), - synapseCount: this.get('synapse_count'), - createdAt: this.get('created_at') + contributor_count_number: '' + this.get('contributor_count') + '', + contributor_count_string: this.get('contributor_count') == 1 ? ' contributor' : ' contributors', + topic_count_number: '' + this.get('topic_count') + '', + topic_count_string: this.get('topic_count') == 1 ? ' topic' : ' topics', + synapse_count_number: '' + this.get('synapse_count') + '', + synapse_count_string: this.get('synapse_count') == 1 ? ' synapse' : ' synapses', }; return obj; } diff --git a/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js b/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js index dccd5b29..13278b28 100644 --- a/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js +++ b/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js @@ -87,7 +87,6 @@ Metamaps.GlobalUI = { Metamaps.Maps.Mine = new Metamaps.Backbone.MapsCollection(myCollection, {id: 'mine', sortBy: 'name'}); Metamaps.Maps.Featured = new Metamaps.Backbone.MapsCollection(featuredCollection, {id: 'featured', sortBy: 'name'}); Metamaps.Maps.Active = new Metamaps.Backbone.MapsCollection(activeCollection, {id: 'active', sortBy: 'updated_at'}); - Metamaps.Maps.New = new Metamaps.Backbone.MapsCollection(newCollection, {id: 'new', sortBy: 'created_at'}); }, openLightbox: function (which) { var self = Metamaps.GlobalUI; @@ -286,20 +285,30 @@ Metamaps.GlobalUI.CreateMap = { Metamaps.GlobalUI.Account = { isOpen: false, - timeOut: null, changing: false, init: function () { var self = Metamaps.GlobalUI.Account; - $(".sidebarAccount").hover(self.open, self.close); + $('.sidebarAccountIcon').click(self.toggleBox); + $('.sidebarAccountBox').click(function(event){ + event.stopPropagation(); + }); + $('body').click(self.close); + }, + toggleBox: function (event) { + var self = Metamaps.GlobalUI.Account; + + if (self.isOpen) self.close(); + else self.open(); + + event.stopPropagation(); }, open: function () { var self = Metamaps.GlobalUI.Account; - Metamaps.Realtime.close(true); - Metamaps.Filter.close(true); + Metamaps.Realtime.close(); + Metamaps.Filter.close(); - clearTimeout(self.timeOut); if (!self.isOpen && !self.changing) { self.changing = true; $('.sidebarAccountBox').fadeIn(200, function () { @@ -308,20 +317,16 @@ Metamaps.GlobalUI.Account = { }); } }, - close: function (force) { + close: function () { var self = Metamaps.GlobalUI.Account; - var time = force ? 0 : 500; - - self.timeOut = setTimeout(function () { - if (!self.changing) { - self.changing = true; - $('.sidebarAccountBox').fadeOut(200, function () { - self.changing = false; - self.isOpen = false; - }); - } - }, time); + if (!self.changing) { + self.changing = true; + $('.sidebarAccountBox').fadeOut(200, function () { + self.changing = false; + self.isOpen = false; + }); + } } }; diff --git a/app/assets/javascripts/metamaps/Metamaps.Views.js b/app/assets/javascripts/metamaps/Metamaps.Views.js index 872e197c..f28fc113 100644 --- a/app/assets/javascripts/metamaps/Metamaps.Views.js +++ b/app/assets/javascripts/metamaps/Metamaps.Views.js @@ -1,5 +1,7 @@ (function () { Metamaps.Views = {}; + + var initialized = false; Metamaps.Views.init = function () { @@ -56,9 +58,9 @@ Metamaps.Views.init = function () { }); var m = Metamaps.Famous.maps.surf; m.setContent(this.el); - if (!Metamaps.initialized) { + if (!initialized) { m.deploy(m._currTarget); - Metamaps.initialized = true; + initialized = true; } Metamaps.Loading.loader.hide(); diff --git a/app/assets/javascripts/metamaps/Metamaps.js b/app/assets/javascripts/metamaps/Metamaps.js index 067ba7b0..2e80877a 100644 --- a/app/assets/javascripts/metamaps/Metamaps.js +++ b/app/assets/javascripts/metamaps/Metamaps.js @@ -100,7 +100,7 @@ Metamaps.Backbone.init = function () { self.Topic = Backbone.Model.extend({ urlRoot: '/topics', - blacklist: ['node', 'created_at', 'updated_at'], + blacklist: ['node', 'created_at', 'updated_at', 'user_name', 'user_image', 'map_count', 'synapse_count'], toJSON: function (options) { return _.omit(this.attributes, this.blacklist); }, @@ -900,15 +900,13 @@ Metamaps.TopicCard = { nodeValues.embeds = ''; } nodeValues.attachments += '
'; - nodeValues.attachments+= '
photo
'; - nodeValues.attachments+= ''; - nodeValues.attachments+= '
audio
'; - nodeValues.attachments+= '
upload
'; + nodeValues.attachments+= ''; + nodeValues.attachments+= '
Upload a file
'; nodeValues.permission = topic.get("permission"); nodeValues.mk_permission = topic.get("permission").substring(0, 2); - //nodeValues.map_count = topic.get("inmaps").length; - //nodeValues.synapse_count = topic.get("synapseCount"); + nodeValues.map_count = topic.get("map_count").toString(); + nodeValues.synapse_count = topic.get("synapse_count").toString(); nodeValues.id = topic.isNew() ? topic.cid : topic.id; nodeValues.metacode = topic.getMetacode().get("name"); nodeValues.metacode_class = 'mbg' + topic.getMetacode().get("name").replace(/\s/g, ''); @@ -1376,7 +1374,6 @@ Metamaps.Realtime = { //Metamaps.Realtime.socket = io.connect('http://localhost:5001'); socket: null, isOpen: false, - timeOut: null, changing: false, mappersOnMap: {}, status: true, // stores whether realtime is True/On or False/Off @@ -1385,7 +1382,11 @@ Metamaps.Realtime = { $(".realtimeOnOff").click(self.toggle); - $(".sidebarCollaborate").hover(self.open, self.close); + $('.sidebarCollaborateIcon').click(self.toggleBox); + $('.sidebarCollaborateBox').click(function(event){ + event.stopPropagation(); + }); + $('body').click(self.close); var mapperm = Metamaps.Active.Map && Metamaps.Active.Map.authorizeToEdit(Metamaps.Active.Mapper); @@ -1397,6 +1398,39 @@ Metamaps.Realtime = { }); } }, + toggleBox: function (event) { + var self = Metamaps.Realtime; + + if (self.isOpen) self.close(); + else self.open(); + + event.stopPropagation(); + }, + open: function () { + var self = Metamaps.Realtime; + + Metamaps.GlobalUI.Account.close(); + Metamaps.Filter.close(); + + if (!self.isOpen && !self.changing) { + self.changing = true; + $('.sidebarCollaborateBox').fadeIn(200, function () { + self.changing = false; + self.isOpen = true; + }); + } + }, + close: function () { + var self = Metamaps.Realtime; + + if (!self.changing) { + self.changing = true; + $('.sidebarCollaborateBox').fadeOut(200, function () { + self.changing = false; + self.isOpen = false; + }); + } + }, toggle: function () { var self = Metamaps.Realtime; @@ -1412,36 +1446,6 @@ Metamaps.Realtime = { self.status = !self.status; $(".sidebarCollaborateIcon").toggleClass("blue"); }, - open: function () { - var self = Metamaps.Realtime; - - Metamaps.GlobalUI.Account.close(true); - Metamaps.Filter.close(true); - - clearTimeout(self.timeOut); - if (!self.isOpen && !self.changing) { - self.changing = true; - $('.sidebarCollaborateBox').fadeIn(200, function () { - self.changing = false; - self.isOpen = true; - }); - } - }, - close: function (force) { - var self = Metamaps.Realtime; - - var time = force ? 0 : 500; - - self.timeOut = setTimeout(function () { - if (!self.changing) { - self.changing = true; - $('.sidebarCollaborateBox').fadeOut(200, function () { - self.changing = false; - self.isOpen = false; - }); - } - }, time); - }, setupSocket: function () { var self = Metamaps.Realtime; var socket = Metamaps.Realtime.socket; @@ -1998,12 +2002,15 @@ Metamaps.Filter = { synapses: [] }, isOpen: false, - timeOut: null, changing: false, init: function () { var self = Metamaps.Filter; - $(".sidebarFilter").hover(self.open, self.close); + $('.sidebarFilterIcon').click(self.toggleBox); + $('.sidebarFilterBox').click(function(event){ + event.stopPropagation(); + }); + $('body').click(self.close); $('.sidebarFilterBox .showAllMetacodes').click(self.filterNoMetacodes); $('.sidebarFilterBox .showAllSynapses').click(self.filterNoSynapses); @@ -2015,13 +2022,20 @@ Metamaps.Filter = { self.bindLiClicks(); self.getFilterData(); }, + toggleBox: function (event) { + var self = Metamaps.Filter; + + if (self.isOpen) self.close(); + else self.open(); + + event.stopPropagation(); + }, open: function () { var self = Metamaps.Filter; - Metamaps.GlobalUI.Account.close(true); - Metamaps.Realtime.close(true); + Metamaps.GlobalUI.Account.close(); + Metamaps.Realtime.close(); - clearTimeout(self.timeOut); if (!self.isOpen && !self.changing) { self.changing = true; @@ -2031,21 +2045,17 @@ Metamaps.Filter = { }); } }, - close: function (force) { + close: function () { var self = Metamaps.Filter; - var time = force ? 0 : 500; + if (!self.changing) { + self.changing = true; - self.timeOut = setTimeout(function () { - if (!self.changing) { - self.changing = true; - - $('.sidebarFilterBox').fadeOut(200, function () { - self.changing = false; - self.isOpen = false; - }); - } - }, time); + $('.sidebarFilterBox').fadeOut(200, function () { + self.changing = false; + self.isOpen = false; + }); + } }, reset: function () { var self = Metamaps.Filter; @@ -2925,7 +2935,6 @@ Metamaps.Map.CheatSheet = { */ Metamaps.Map.InfoBox = { isOpen: false, - timeOut: null, changing: false, selectingPermission: false, init: function () { @@ -2940,13 +2949,24 @@ Metamaps.Map.InfoBox = { $('.yourMap .mapPermission').click(self.onPermissionClick); - $(".mapInfo").hover(self.open, self.close); + $('.mapInfoIcon').click(self.toggleBox); + $('.mapInfoBox').click(function(event){ + event.stopPropagation(); + }); + $('body').click(self.close); }, - open: function (event) { - var self = Metamaps.GlobalUI.Account; + toggleBox: function (event) { + var self = Metamaps.Map.InfoBox; - clearTimeout(self.timeOut); - if (!self.isOpen && !self.changing && event.target.className.indexOf("openCheatsheet") === -1) { + if (self.isOpen) self.close(); + else self.open(); + + event.stopPropagation(); + }, + open: function () { + var self = Metamaps.Map.InfoBox; + + if (!self.isOpen && !self.changing) { self.changing = true; $('.mapInfoBox').fadeIn(200, function () { self.changing = false; @@ -2955,17 +2975,15 @@ Metamaps.Map.InfoBox = { } }, close: function () { - var self = Metamaps.GlobalUI.Account; + var self = Metamaps.Map.InfoBox; - self.timeOut = setTimeout(function () { - if (!self.changing) { - self.changing = true; - $('.mapInfoBox').fadeOut(200, function () { - self.changing = false; - self.isOpen = false; - }); - } - }, 500); + if (!self.changing) { + self.changing = true; + $('.mapInfoBox').fadeOut(200, function () { + self.changing = false; + self.isOpen = false; + }); + } }, onPermissionClick: function () { var self = Metamaps.Map.InfoBox; diff --git a/app/assets/stylesheets/Fonts/din-reg.eot b/app/assets/stylesheets/Fonts/din-reg.eot new file mode 100644 index 00000000..0aab448a Binary files /dev/null and b/app/assets/stylesheets/Fonts/din-reg.eot differ diff --git a/app/assets/stylesheets/Fonts/din-reg.svg b/app/assets/stylesheets/Fonts/din-reg.svg new file mode 100644 index 00000000..ba412d34 --- /dev/null +++ b/app/assets/stylesheets/Fonts/din-reg.svg @@ -0,0 +1,958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/assets/stylesheets/Fonts/din-reg.ttf b/app/assets/stylesheets/Fonts/din-reg.ttf new file mode 100644 index 00000000..8e000258 Binary files /dev/null and b/app/assets/stylesheets/Fonts/din-reg.ttf differ diff --git a/app/assets/stylesheets/Fonts/din-reg.woff b/app/assets/stylesheets/Fonts/din-reg.woff new file mode 100644 index 00000000..d6451539 Binary files /dev/null and b/app/assets/stylesheets/Fonts/din-reg.woff differ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index cff4c709..4b197620 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -650,7 +650,7 @@ li.accountInvite span { width: 320px; padding: 10px; text-align: center; - overflow-y: scroll; + overflow-y: auto; } h3.filterBox { text-align: left; diff --git a/app/assets/stylesheets/base.css b/app/assets/stylesheets/base.css index 6173e034..8d73272c 100644 --- a/app/assets/stylesheets/base.css +++ b/app/assets/stylesheets/base.css @@ -13,17 +13,13 @@ left:100px; width:300px; min-height:360px; - color:#FFF; + background-color:#F5F5F5; text-align: left; overflow: visible; z-index:14000; - background: #FFF; + color: #424242; border-radius:2px; - box-shadow: 6px 6px 8px rgba(0,0,0,0.4); -} - -.showcard .contributor { - font-size:14px; + box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16); } .text { @@ -45,32 +41,17 @@ position:relative; width:100%; height:100%; - color:#000; z-index: 25; } -.CardOnGraph .scroll { - display:block; - padding:5px 0 10px 10px; -} - -.CardOnGraph .type { - position: absolute; - color: white; - top: -22px; - right: 0; - font-weight: bold; - font-size: 20px; - line-height: 24px; -} - .CardOnGraph .title { - font-size:22px; - line-height:25px; - display:block; - padding:5px; - font-weight: bold; + font-size: 18px; + line-height: 22px; + display: block; + padding: 8px 16px; + height: 80px; text-align: center; + font-family: 'din-regular', sans-serif; } .best_in_place_name { @@ -78,50 +59,56 @@ } .best_in_place_name textarea, .best_in_place_name input { + font-family: 'din-regular', sans-serif; + color: #424242; + font-size: 18px; + line-height: 22px; height: 15px; padding: 5px 0; width: 100%; margin: 0; border: 0; outline: none; -font-size: 22px; -font-weight:bold; -line-height: 25px; -background: white; -color: black; +background: none; text-align:center; -font-family: 'LatoLight'; } -.desc { - font-size:15px; - line-height:19px; +.CardOnGraph .scroll { + display:block; + padding: 8px 16px; + height: 152px; + font-size: 12px; + line-height:15px; + font-family: helvetica, sans-serif; } -.best_in_place_desc textarea { + +.CardOnGraph .best_in_place_desc textarea { + font-size: 12px; + line-height:15px; + font-family: helvetica, sans-serif; + color: #424242; padding: 0; width: 100%; margin: 0; border: 0; outline: none; -font-size: 15px; -line-height: 19px; -background: white; -color: black; -font-family: 'LatoLight'; +font-size: 12px; +line-height: 15px; +background: none; } -.desc h3 { +.CardOnGraph .desc h3 { font-style:normal; margin-top:5px; } -.best_in_place_desc input { +.CardOnGraph .best_in_place_desc input { float: right; margin: 2px 0px 0px 2px; padding: 1px 5px; } -.best_in_place_desc { +.CardOnGraph .best_in_place_desc { display:block; margin-top:2px; } @@ -132,47 +119,50 @@ font-family: 'LatoLight'; .CardOnGraph .links { position:relative; - border-bottom: 1px solid #AAAAAA; - border-top: 1px solid #AAAAAA; + border-bottom: 1px solid #BDBDBD; + border-top: 1px solid #BDBDBD; } .linkItem { float:left; - min-width:40px; - height:40px; + min-width:46px; + height:46px; background-repeat: no-repeat; - background-position: center center; - background-size: 27px 27px; + background-position: 0 center; + background-size: 24px 24px; z-index: 1; position: relative; + color: #424242; + font-size: 12px; + line-height:12px; + height:12px; + padding:17px 0; +} +.linkItem a { + color: #424242; } .CardOnGraph .icon { position:absolute; width:100%; z-index:1; + padding: 0; } .linkItem.contributor { background-image: url(MMCCicon_mapper_black.png); - margin-left:20px; + margin-left:32px; z-index:1; + padding:17px 0 17px 28px; } .linkItem.mapCount { background-image: url(MMCCicon_map_black.png); - background-size: 22px 22px; -background-position: 0px center; -line-height: 40px; -min-width: 16px; -padding-left: 24px; -color:black; + min-width: 16px; + padding:17px 0 17px 28px; } .linkItem.synapseCount { background-image: url(MMCCicon_synapse_black.png); - background-size: 22px 22px; -background-position: 0px center; -line-height: 40px; -min-width: 16px; -padding-left: 24px; + min-width: 16px; + padding:17px 0 17px 28px; } .linkItem.mapPerm { @@ -212,7 +202,7 @@ cursor: pointer; background-repeat: no-repeat; background-position: center center; background-size: 27px 27px; - background-color:white; + background-color: #F5F5F5; } .mapPerm .permissionSelect .commons { background-image: url(MMCCicon_commons.png); @@ -233,22 +223,19 @@ cursor: pointer; background-image: url(MMCCicon_private_black.png); } -.linkItem.topicPopout { - background-image: url(MMCCicon_pop-out_black.png); -} - .CardOnGraph .metacodeTitle { font-style: italic; font-family: 'vinyl'; text-transform: uppercase; position: absolute; - line-height: 36px; + line-height: 24px; + height:24px; font-size: 20px; display: none; width: 90%; - padding-left: 10%; - padding-top: 4px; + padding: 11px 0 11px 10%; background-color: #64BC61; + color: #000; } .permission.canEdit .metacodeTitle { cursor:pointer; @@ -262,12 +249,12 @@ cursor: pointer; .CardOnGraph .metacodeImage { cursor:move; - width:50px; - height:50px; + width:46px; + height:46px; position:absolute; - left:-25px; - top:-5px; - background-size:50px 50px; + left:-23px; + top:0; + background-size:46px 46px; background-position:0 0; background-repeat:no-repeat; } @@ -331,9 +318,9 @@ float:left; .CardOnGraph .attachments { - border-top: 1px solid #AAAAAA; + border-top: 1px solid #BDBDBD; width:100%; - height:48px; + height:47px; } .attachments a { @@ -349,7 +336,7 @@ float:left; .addAttachment div { display: inline-block; - width: 72px; + width: 150px; height: 23px; text-align: center; padding-top: 25px; @@ -547,14 +534,12 @@ font-family: 'LatoLight'; .map { display:inline-block; width:220px; - height:308px; - padding: 16px 0; - color:#FFF; + height:340px; + font-size: 12px; text-align: left; overflow: visible; background: #424242; border-radius:2px; - box-shadow: 6px 6px 8px rgba(0,0,0,0.4); margin:16px 16px 16px 19px; } @@ -573,19 +558,33 @@ font-family: 'LatoLight'; flex-direction: column; position:relative; width:100%; - height:320px; - color:#000; + height:308px; + padding: 16px 0; + color:#F5F5F5; } -.mapCard .metacodeImage { -width: 50px; -height: 50px; -position: absolute; -left: -25px; -top: -5px; -background-size: 50px 50px; -background-position: 0 0; -background-repeat: no-repeat; +.mapCard .title { + font-size:18px; + line-height:22px; + display:block; + padding: 0 16px; + text-align: center; + -webkit-box-flex: none; /* OLD - iOS 6-, Safari 3.1-6 */ + -moz-box-flex: none; /* OLD - Firefox 19- */ + -webkit-flex: none; /* Chrome */ + -ms-flex: none; /* IE 10 */ + flex: none; /* NEW, Spec - Opera 12.1, Firefox 20+ */ + font-family: 'din-regular', sans-serif; +} + +.mapCard .mapScreenshot { + width: 188px; + height: 126px; + padding: 8px 16px; +} +.mapCard .mapScreenshot img { + width: 188px; + height: 126px; } .mapCard .scroll { @@ -595,41 +594,21 @@ background-repeat: no-repeat; -webkit-flex: 1; /* Chrome */ -ms-flex: 1; /* IE 10 */ flex: 1; /* NEW, Spec - Opera 12.1, Firefox 20+ */ - overflow:hidden; - padding:5px 0 5px 10px; + overflow-y:auto; + padding:0 16px 8px; + font-family: helvetica, sans-serif; + font-style: italic; + font-size: 12px; } .mCS_no_scrollbar { padding-right: 5px; -} - -.mapCard .type { - position: absolute; - color: white; - top: -22px; - right: 0; - font-weight: bold; - font-size: 20px; - line-height: 24px; } -.mapCard .title { - font-size:22px; - line-height:25px; - display:block; - padding:5px; - font-weight: bold; - text-align: center; - -webkit-box-flex: none; /* OLD - iOS 6-, Safari 3.1-6 */ - -moz-box-flex: none; /* OLD - Firefox 19- */ - -webkit-flex: none; /* Chrome */ - -ms-flex: none; /* IE 10 */ - flex: none; /* NEW, Spec - Opera 12.1, Firefox 20+ */ -} - -.mapCard .links { +.mapCard .mapMetadata { + font-family: 'din-regular', sans-serif; + font-size: 12px; position:relative; - border-bottom: 1px solid #AAAAAA; - border-top: 1px solid #AAAAAA; + border-top: 1px solid #BDBDBD; -webkit-box-flex: none; /* OLD - iOS 6-, Safari 3.1-6 */ -moz-box-flex: none; /* OLD - Firefox 19- */ -webkit-flex: none; /* Chrome */ @@ -637,16 +616,24 @@ background-repeat: no-repeat; flex: none; /* NEW, Spec - Opera 12.1, Firefox 20+ */ } -.mapCard .icon { - position:absolute; - width:100%; - z-index:1; +.mapCard .metadataSection { + padding: 8px 16px 0 16px; + width: 78px; + float: left; } -.linkItem.topicCount { - background-image: url(MMCCicon_topic.png); - background-size: 22px 22px; -background-position: 0px center; -line-height: 40px; -min-width: 16px; -padding-left: 24px; + +.mapPermission { + font-family: 'din-medium', sans-serif; +} +.cCountColor { + font-family: 'din-medium', sans-serif; + color: #DB5D5D; +} +.tCountColor { + font-family: 'din-medium', sans-serif; + color: #4FC059; +} +.sCountColor { + font-family: 'din-medium', sans-serif; + color: #DAB539; } \ No newline at end of file diff --git a/app/assets/stylesheets/clean.css b/app/assets/stylesheets/clean.css index 40688d0f..c0e4a4e8 100644 --- a/app/assets/stylesheets/clean.css +++ b/app/assets/stylesheets/clean.css @@ -8,6 +8,16 @@ font-weight: normal; font-style: normal; } +@font-face { + font-family: 'din-regular'; + src: url('/assets/Fonts/din-reg.eot'); + src: url('/assets/Fonts/din-reg.eot?#iefix') format('embedded-opentype'), + url('/assets/Fonts/din-reg.woff') format('woff'), + url('/assets/Fonts/din-reg.ttf') format('truetype'), + url('/assets/Fonts/din-reg.svg#din-reg') format('svg'); + font-weight: normal; + font-style: normal; +} .backface-visible { -webkit-backface-visibility: visible !important; @@ -473,7 +483,7 @@ .upperRightBox { position: fixed; - top:42px; + top:52px; right:24px; background-color: #E5E5E5; border-radius: 4px; @@ -579,22 +589,15 @@ background-size: 27px 27px; } -.mapInfo { +.mapInfoIcon { position: relative; top: 56px; /* puts it just offscreen */ background: url('MMCCicon_info.png') no-repeat center center; background-size: 19px 19px; } -.mapPage .mapInfo { +.mapPage .mapInfoIcon { top: 0; } -/*.mapInfo.animations { - -webkit-transition-property: top; - -moz-transition-property: top; - -o-transition-property: top; - -ms-transition-property: top; - transition-property: top; -}*/ /* end infoAndHelp */ @@ -655,6 +658,7 @@ margin-top:52px; height:42px; background-color:#EEEEEE; + box-shadow: 0px 3px 3px rgba(0,0,0,0.23), 0 3px 3px rgba(0,0,0,0.16); } .exploreMapsCenter { @@ -682,7 +686,7 @@ } .mapsWrapper { - overflow-y: scroll; + overflow-y: auto; } /* end explore maps */ diff --git a/app/controllers/maps_controller.rb b/app/controllers/maps_controller.rb index 933f29e1..f67c22d4 100644 --- a/app/controllers/maps_controller.rb +++ b/app/controllers/maps_controller.rb @@ -27,10 +27,6 @@ class MapsController < ApplicationController @maps = Map.order("name ASC").find_all_by_featured(true) @request = "featured" - elsif request.path.index("/explore/new") != nil - @maps = Map.order("created_at DESC").limit(20) - @request = "new" - elsif request.path.index('/explore/mine') != nil # looking for maps by me if !authenticated? redirect_to activemaps_url and return @@ -41,8 +37,11 @@ class MapsController < ApplicationController elsif request.path.index('/maps/mappers/') != nil # looking for maps by a mapper @user = User.find(params[:id]) @maps = Map.order("name ASC").find_all_by_user_id(@user.id) - @request = "you" if authenticated? && @user == @current - @request = "other" if authenticated? && @user != @current + if authenticated? && @user == @current + @request = "you" + else + @request = "other" + end elsif request.path.index('/explore/topics/') != nil # looking for maps by a certain topic they include @topic = Topic.find(params[:id]).authorize_to_show(@current) @@ -61,7 +60,13 @@ class MapsController < ApplicationController end respond_to do |format| - format.html { respond_with(@maps, @request, @user) } + format.html { + if @request == "you" + redirect_to root_url and return + else + respond_with(@maps, @request, @user) + end + } format.json { render json: @maps } end end diff --git a/app/models/map.rb b/app/models/map.rb index 75857c8f..74fce74d 100644 --- a/app/models/map.rb +++ b/app/models/map.rb @@ -8,6 +8,15 @@ class Map < ActiveRecord::Base has_many :topics, :through => :topicmappings has_many :synapses, :through => :synapsemappings + # This method associates the attribute ":image" with a file attachment + has_attached_file :screenshot, :styles => { + :thumb => ['188x126#', :png], + :full => ['1880x1260#', :png] + } + + # Validate the attached image is image/jpg, image/png, etc + validates_attachment_content_type :screenshot, :content_type => /\Aimage\/.*\Z/ + def mappings topicmappings + synapsemappings end @@ -49,8 +58,12 @@ class Map < ActiveRecord::Base self.user.image.url end + def contributor_count + self.contributors.length + end + def as_json(options={}) - super(:methods =>[:user_name, :user_image, :topic_count, :synapse_count]) + super(:methods =>[:user_name, :user_image, :topic_count, :synapse_count, :contributor_count]) end ##### PERMISSIONS ###### diff --git a/app/models/topic.rb b/app/models/topic.rb index e2a44ba4..be6f8b50 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -46,8 +46,16 @@ class Topic < ActiveRecord::Base self.user.image.url end + def map_count + self.maps.count + end + + def synapse_count + self.synapses.count + end + def as_json(options={}) - super(:methods =>[:user_name, :user_image]) + super(:methods =>[:user_name, :user_image, :map_count, :synapse_count]) end # sends push updates through redis to websockets for realtime updates diff --git a/app/views/layouts/_lowermapelements.html.erb b/app/views/layouts/_lowermapelements.html.erb index 9d902958..9942c139 100644 --- a/app/views/layouts/_lowermapelements.html.erb +++ b/app/views/layouts/_lowermapelements.html.erb @@ -1,4 +1,4 @@ -
+
E
C
+
@@ -6,9 +6,8 @@
-
- <%= render :partial => 'maps/mapinfobox' %> -
+ <%= render :partial => 'maps/mapinfobox' %> +
\ No newline at end of file diff --git a/app/views/layouts/_templates.html.erb b/app/views/layouts/_templates.html.erb index a71b1a50..3c4036c2 100644 --- a/app/views/layouts/_templates.html.erb +++ b/app/views/layouts/_templates.html.erb @@ -12,22 +12,23 @@
{{name}} - - + +
+ +
{{desc}}
-
-
+
+
+
{{{contributor_count_number}}}{{contributor_count_string}}
+
{{{topic_count_number}}}{{topic_count_string}}
+
{{permission}}
+
{{{synapse_count_number}}}{{synapse_count_string}}
+
+
@@ -158,15 +159,16 @@
{{metacode}}
-
-
Created by {{username}} on {{date}}
+
+ {{username}}
- + {{map_count}} -
{{synapse_count}}
+ + {{synapse_count}} +
-
{{{metacode_select}}}
diff --git a/app/views/maps/_mapinfobox.html.erb b/app/views/maps/_mapinfobox.html.erb index 0d7da05a..226a897f 100644 --- a/app/views/maps/_mapinfobox.html.erb +++ b/app/views/maps/_mapinfobox.html.erb @@ -47,7 +47,8 @@
<% if @map.user == user %> - <%= link_to 'Delete', map_path(@map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete %> + <%= link_to 'Delete', map_path(@map), :class => 'delete', :confirm => 'Delete this map (nodes and synapses will remain)?', :method => :delete, + :data => { :bypass => 'true'} %> <% end %>
diff --git a/config/routes.rb b/config/routes.rb index a1d31995..ef03d2e8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -24,7 +24,6 @@ Metamaps::Application.routes.draw do match 'explore/active', to: 'maps#index', via: :get, as: :activemaps match 'explore/featured', to: 'maps#index', via: :get, as: :featuredmaps - match 'explore/new', to: 'maps#index', via: :get, as: :newmaps match 'explore/mine', to: 'maps#index', via: :get, as: :mymaps match 'maps/mappers/:id', to: 'maps#index', via: :get, as: :usermaps match 'maps/topics/:id', to: 'maps#index', via: :get, as: :topicmaps diff --git a/db/migrate/20140815162253_add_screenshot_to_maps.rb b/db/migrate/20140815162253_add_screenshot_to_maps.rb new file mode 100644 index 00000000..c42cca51 --- /dev/null +++ b/db/migrate/20140815162253_add_screenshot_to_maps.rb @@ -0,0 +1,9 @@ +class AddScreenshotToMaps < ActiveRecord::Migration + def self.up + add_attachment :maps, :screenshot + end + + def self.down + remove_attachment :maps, :screenshot + end +end diff --git a/db/schema.rb b/db/schema.rb index ec86b421..4c22e7e5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140707161810) do +ActiveRecord::Schema.define(:version => 20140815162253) do create_table "in_metacode_sets", :force => true do |t| t.integer "metacode_id" @@ -41,9 +41,13 @@ ActiveRecord::Schema.define(:version => 20140707161810) do t.text "desc" t.text "permission" t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.boolean "featured" + t.string "screenshot_file_name" + t.string "screenshot_content_type" + t.integer "screenshot_file_size" + t.datetime "screenshot_updated_at" end create_table "metacode_sets", :force => true do |t| diff --git a/phantomjsSetup.txt b/phantomjsSetup.txt new file mode 100644 index 00000000..f8916c30 --- /dev/null +++ b/phantomjsSetup.txt @@ -0,0 +1,21 @@ + +// 64 bit ubuntu +cd /usr/local/share +sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2 +sudo tar xjf phantomjs-1.9.7-linux-x86_64.tar.bz2 +sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs +sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs +sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs + + +// 32 bit ubuntu +cd /usr/local/share +sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2 +sudo tar xjf phantomjs-1.9.7-linux-i686.tar.bz2 +sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-i686/bin/phantomjs /usr/local/share/phantomjs +sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-i686/bin/phantomjs /usr/local/bin/phantomjs +sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-i686/bin/phantomjs /usr/bin/phantomjs + +// on either running +phantomjs -v +// will confirm it's installed \ No newline at end of file diff --git a/public/famous/templates.js b/public/famous/templates.js index 941ff7ad..c241d596 100644 --- a/public/famous/templates.js +++ b/public/famous/templates.js @@ -11,38 +11,24 @@ t.logoContent += '
  • Get Involved! t.logoContent += ''; /* logged out explore maps bars */ - t.activeContent = 'Recently Active'; - t.activeContent += 'Featured'; - t.activeContent += 'New'; + t.activeContent = 'Recently Active Maps'; + t.activeContent += 'Featured Maps'; - t.featuredContent = 'Recently Active'; - t.featuredContent += 'Featured'; - t.featuredContent += 'New'; - - t.newContent = 'Recently Active'; - t.newContent += 'Featured'; - t.newContent += 'New'; + t.featuredContent = 'Recently Active Maps'; + t.featuredContent += 'Featured Maps'; /* logged in explore maps bars */ t.mineAuthContent = 'My Maps'; t.mineAuthContent += 'Recently Active'; t.mineAuthContent += 'Featured'; - t.mineAuthContent += 'New'; t.activeAuthContent = 'My Maps'; t.activeAuthContent += 'Recently Active'; t.activeAuthContent += 'Featured'; - t.activeAuthContent += 'New'; t.featuredAuthContent = 'My Maps'; t.featuredAuthContent += 'Recently Active'; t.featuredAuthContent += 'Featured'; - t.featuredAuthContent += 'New'; - - t.newAuthContent = 'My Maps'; - t.newAuthContent += 'Recently Active'; - t.newAuthContent += 'Featured'; - t.newAuthContent += 'New'; module.exports = t; });