From c9550393065bf4347746a236d282bdb368887ff3 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Thu, 4 Dec 2014 00:35:04 +0000 Subject: [PATCH] Improve form layout --- public/stylesheets/style.css | 3 ++- routes/index.js | 6 ++++++ views/index.ejs | 19 +++++++++++++------ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 4ff3160..1ed0d7f 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -40,7 +40,8 @@ h2 { } .share-form { - margin: 50px 0; + margin-top: 50px; + margin-bottom: 50px; text-align: center; } diff --git a/routes/index.js b/routes/index.js index 0a76cd0..2f1cd40 100644 --- a/routes/index.js +++ b/routes/index.js @@ -59,6 +59,12 @@ router.post('/search', function(req, res) { // determine spotify or google music var url = parse(req.body.url); + if (!url.host) { + req.flash('search-error', 'Please paste a link below to find matches'); + res.redirect('/'); + return; + } + if (url.host.match(/rd\.io$/) || url.host.match(/rdio\.com$/)) { rdio.lookupUrl(url.href, function(result) { if (!result.id) { diff --git a/views/index.ejs b/views/index.ejs index 4fa8d38..ca8b4cf 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -16,17 +16,24 @@

match.audio

+ +

Make sharing music from subscription services better.