Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added campaign enrollment (for register, login)

added video as lead to the starting page
added finish course handling
allow for separate action link in video type
renamed assets.js to utils.js and changed call sites
moved merge into assets.js
  • Loading branch information...
commit 9499d6491025ecec9cb1174f1594aabac6bcb322 1 parent bbf1044
@jexp jexp authored
View
5 app.js
@@ -33,7 +33,8 @@ var express = require('express')
, geoip = require("./helpers/geoip")
, render = require("./helpers/render")
, videos = require("./helpers/videos")
- , asset = require("./helpers/assets.js").asset
+ , asset = require("./helpers/utils.js").asset
+ , merge = require("./helpers/utils.js").merge
, twitter = require("./helpers/twitter.js")
, mylog = require("./helpers/log.js")
, kissmetrics = require('kissmymetrics');
@@ -303,7 +304,7 @@ route_get('/*/', function (req, res) {
//route_get('/', forward("/index"));
app.get("/", function (req, res) {
var page = app.locals.pages["index"];
- var params = page_handling.merge(app.locals, { path:page.path, title:page.title || "", locals:app.locals });
+ var params = merge(app.locals, { path:page.path, title:page.title || "", locals:app.locals });
res.render("partials/page", params);
});
View
6 helpers/assets.js
@@ -1,6 +0,0 @@
-exports.asset = function(file) {
- // todo check if locally available
- // return "/assets"
- // return "https://s3.amazonaws.com/assets.neo4j.org/"+file;
- return "http://assets.neo4j.org/"+file;
-};
View
10 helpers/content.js
@@ -1,5 +1,5 @@
var render = require('./render');
-var asset = require("../helpers/assets.js").asset;
+var asset = require("../helpers/utils.js").asset;
exports.content = {
install: {
@@ -472,12 +472,14 @@ exports.content = {
thumbnail: asset("img/logo/gyaanexchange.png")
},
online_intro_training: {
- type: "link",
+ type: "video",
path: "/learn/online_course",
title: "Online Training: Neo4j Introduction",
+ src: "https://player.vimeo.com/video/77866447",
// author: ["mesirii","akollegger"],
- introText: "Short on time? Or need to learn on your own time? Learn at your own pace with online training courses. These courses can stand on their own or as a complement to classroom training. Get started today!",
- thumbnail: asset("img/logo/online-training.png")
+ introText: "Short on time? Or need to learn on your own time? Learn at your own pace with online training courses. These courses can stand on their own or as a complement to classroom training.",
+ thumbnail: asset("img/logo/online-training.png"),
+ actionText: "Get started today"
},
python_safari: {
type: "link",
View
2  helpers/data.js
@@ -1,4 +1,4 @@
-var asset = require("../helpers/assets.js").asset
+var asset = require("../helpers/utils.js").asset
//THIS IS OVERWRITTEN FROM GOOGLE
exports.contributors = {
View
12 helpers/munchkin.js
@@ -7,7 +7,7 @@ var marketoSecret = process.env.MARKETO_SECRET;
var marketoClient;
-var CAMPAIGN="1464";
+var CAMPAIGNS={register:"5642",login:"5643",finish:"5644"};
try {
soap.createClient(wsdlUrl, function(err, client) {
@@ -78,7 +78,7 @@ exports.listCampaigns = function (fun) {
var params = { source:"MKTOWS" };
marketoClient.getCampaignsForSource(params, function(err, result) {
if (err) {
- console.log("Error listing campaigns",err);
+ console.log("Error listing campaigns",err) ;
fun(err);
} else {
fun(null,result);
@@ -129,20 +129,22 @@ exports.add_route = function(path,app) {
});
app.post(path, function(req,res) {
var info = req.body;
+ var activity = info.Activity||"register";
+ delete info.Activity;
console.log(info);
- associateMarketoLead(info, function(error,data) {
+ associateMarketoLead(info, function(error,associate_result) {
if (error) {
console.log(error);
res.send(500,JSON.stringify(error));
return;
}
- requestCampaign(info.Email,CAMPAIGN,function(error, data) {
+ requestCampaign(info.Email,CAMPAIGNS[activity],function(error, campaign_result) {
if (error) {
console.log(error);
res.send(500,JSON.stringify(error));
return;
}
- res.send(200,JSON.stringify(data));
+ res.send(200,JSON.stringify(associate_result));
})
})
})
View
17 helpers/page_handling.js
@@ -1,17 +1,5 @@
var fs=require("fs");
-
-function merge() {
- var res={};
- for (i in arguments) {
- var arg=arguments[i];
- for (prop in arg) {
- if (arg.hasOwnProperty(prop)) {
- res[prop] = arg[prop];
- }
- }
- }
- return res;
-}
+var merge = require("../helpers/utils.js").merge;
exports.init = function(app,pages) {
@@ -66,5 +54,4 @@ exports.init = function(app,pages) {
}
}
});
-}
-exports.merge=merge
+}
View
6 helpers/pages.js
@@ -1,7 +1,7 @@
var render = require('./render');
var content = require("./content.js").content;
var video = require("./content.js").video;
-var asset = require("../helpers/assets.js").asset;
+var asset = require("../helpers/utils.js").asset;
exports.pages = {
index : {
@@ -10,7 +10,8 @@ exports.pages = {
config: { tile_page: true, no_slides: true },
featured: [
// content.videos.strata,
- content.videos.ian_graphdb_neo4j,
+// content.videos.ian_graphdb_neo4j,
+ content.links.online_intro_training,
// content.install.download_button
{
type: "include",
@@ -29,7 +30,6 @@ exports.pages = {
},
"licensing",
content.links.customers,
- content.links.online_intro_training,
"graphgist_challenge",
// "events",
"trainings",
View
21 helpers/utils.js
@@ -0,0 +1,21 @@
+exports.asset = function(file) {
+ // todo check if locally available
+ // return "/assets"
+ // return "https://s3.amazonaws.com/assets.neo4j.org/"+file;
+ return "http://assets.neo4j.org/"+file;
+};
+
+exports.merge = function() {
+ var res={};
+ for (i in arguments) {
+ if (arguments.hasOwnProperty(i)) {
+ var arg=arguments[i];
+ for (prop in arg) {
+ if (arg.hasOwnProperty(prop)) {
+ res[prop] = arg[prop];
+ }
+ }
+ }
+ }
+ return res;
+};
View
2  routes/routes.js
@@ -1,4 +1,4 @@
-var asset = require("../helpers/assets.js").asset
+var asset = require("../helpers/utils.js").asset
/*
* GET home page.
View
20 views/_download_thanks.ejs
@@ -31,10 +31,28 @@ Please refer to the <a href="#browser-matrix" onclick="$('#browser-matrix').show
<% include browser_matrix %>
+<div class="featured">
+ <div class="slide video" style="min-height: 277px;">
+ <div class="image">
+ <img class="thumbnail" src="http://assets.neo4j.org/img/logo/online-training.png" data-src="https://player.vimeo.com/video/77866447">
+ </div>
+ <div class="text">
+ <div class="caption">
+ <h3 id="">Online Training: Neo4j Introduction</h3>
+ <i class="icon icon-facetime-video"></i>Short on time? Or need to learn on your own time? Learn at your own pace with online training courses. These courses can stand on their own or as a complement to classroom training.
+ </div>
+ <div class="content">
+
+ </div>
+ </div>
+ <div class="clear"></div>
+ </div>
+ <a class="link_action" href="/learn/online_course">Get started today »</a>
+</div>
+
<div class="featured" class="mainElement">
<div class="slide article">
<div class="content">
-<!--<h2>While you're waiting for your download:</h2>-->
<p>For the best developer experience, subscribe and stay informed about events, releases and technical articles on graphs and development with Neo4j.</p>
<div style="margin-top: -20px;margin-bottom: -10px;"><iframe style="visibility:visible;" src="http://www.neotechnology.com/wp-content/themes/Neo_Technology/signup.html" style="border:0;padding: 5;" width="300px" height="75px" frameborder="0" scrolling="no"></iframe></div>
</div>
View
41 views/learn/online_course.ejs
@@ -221,23 +221,48 @@
info["data"]=sessionId;
_kmq.push(['record', 'neo4j-course-'+action, info]);
_gaq.push(['_trackEvent','neo4j-course-'+action,email,online_course,sessionId,name,info["company"],info["country"]]);
+ var marketoInfo = {Email: email, Activity:action};
if (action=="register") {
- var marketoInfo = {FirstName:info.firstname, LastName:info.name, Email: email, Company: info.company, Country:info.country,
- HowdoyouuseNeo4j:info.usage, PostalCode:info.zip};
+ marketoInfo = {FirstName:info.firstname, LastName:info.name, Email: email, Company: info.company, Country:info.country,
+ HowdoyouuseNeo4j:info.usage, PostalCode:info.zip, Activity:action};
if (info.newsletter) {
var nlLangKey = (info.newsletter_lang == "German" ? "Subscription-DACHNewsletterinGerman" : "Monthlynewsletter");
marketoInfo[ nlLangKey ]=true;
}
-// var res = mktoMunchkinFunction('associateLead',marketoInfo);
- $.ajax("/api/marketo", {type:"POST",contentType:"application/json",data:JSON.stringify(marketoInfo),
- success:function(data,status) {
- console.log("marketo update",data,status)
- }});
}
- }
+
+ $.ajax("/api/marketo", {type:"POST",contentType:"application/json",data:JSON.stringify(marketoInfo),
+ success:function(data,status) {
+ console.log("marketo update",data,status)
+ }});
+ }
});
return false;
});
+
+ var redirectUrl = '/learn/intro_course_finish';
+ window.addEventListener('message', function(e) {
+ var data;
+// console.log(e.data,e);
+ if (e.origin === window.location.origin) {
+ try {
+ data = JSON.parse(e.data);
+ if (data.event=='courseEnd') {
+ var marketoInfo = {Email: data.email, Activity:"finish"};
+ $.ajax("/api/marketo",
+ {type:"POST",contentType:"application/json",data:JSON.stringify(marketoInfo),
+ success:function(data,status) {
+ console.log("marketo update finish ",marketoInfo,data,status);
+ },
+ error:function(data,status) {
+ console.log("marketo error finish ",marketoInfo,data,status);
+ }
+ });
+ setTimeout(function() {window.location.href = redirectUrl;}, 300);
+ }
+ } catch (e) { console.log(e); }
+ }
+ });
})
</script>
<% include ../foot %>
View
2  views/partials/video/_full.ejs
@@ -20,5 +20,5 @@ console.log("item.content",item.content);
</div>
<div class="clear"></div>
</div>
- <%- lightbox_link(item.src, (item.actionText || 'Watch the video') + ' &raquo;','link action') %>
+ <%- hasPath ? link_to(item.path, (item.actionText || 'Learn more') + ' &raquo;', 'link_action') : lightbox_link(item.src, (item.actionText || 'Watch the video') + ' &raquo;','link action') %>
</div><!-- featured -->
Please sign in to comment.
Something went wrong with that request. Please try again.