From 45ff453df6f861430536b526ce7bd504107f24ea Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 23 Feb 2017 11:01:50 +0100 Subject: [PATCH] initial structure (#1) --- .gitignore | 1 + .travis.yml | 2 +- index.js | 35 +++++++++++------ public/lang-logo.png | Bin 2293 -> 0 bytes public/node.svg | 17 --------- public/style.css | 0 public/stylesheets/main.css | 27 ------------- views/pages/about.ejs | 6 +++ views/pages/categories.ejs | 6 +++ views/pages/db.ejs | 24 ------------ views/pages/index.ejs | 69 ++-------------------------------- views/pages/manufacturers.ejs | 6 +++ views/pages/search.ejs | 6 +++ views/partials/footer.ejs | 2 + views/partials/header.ejs | 26 +++++++++++-- views/partials/nav.ejs | 33 ---------------- 16 files changed, 77 insertions(+), 183 deletions(-) delete mode 100644 public/lang-logo.png delete mode 100644 public/node.svg create mode 100644 public/style.css delete mode 100644 public/stylesheets/main.css create mode 100644 views/pages/about.ejs create mode 100644 views/pages/categories.ejs delete mode 100644 views/pages/db.ejs create mode 100644 views/pages/manufacturers.ejs create mode 100644 views/pages/search.ejs create mode 100644 views/partials/footer.ejs delete mode 100644 views/partials/nav.ejs diff --git a/.gitignore b/.gitignore index f97065aee3..f205508db5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ npm-debug.log *.env *.dev .DS_Store +*.sublime-* # Docker Dockerfile diff --git a/.travis.yml b/.travis.yml index fc4b1d4396..76a5977ae3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,4 +6,4 @@ node_js: - "4" cache: directories: -- node_modules # cache NPM dependencies \ No newline at end of file + - node_modules # cache NPM dependencies \ No newline at end of file diff --git a/index.js b/index.js index 949573f692..d44d570a37 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,4 @@ var express = require('express'); -var cool = require('cool-ascii-faces'); var app = express(); app.set('port', (process.env.PORT || 5000)); @@ -11,23 +10,35 @@ app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.get('/', function(request, response) { - response.render('pages/index'); + response.render('pages/index', { + title: 'Open Fixture Library' + }); }); -app.get('/cool', function(request, response) { - response.send(cool()); +app.get('/about', function(request, response) { + response.render('pages/about', { + title: 'About - Open Fixture Library' + }); }); -app.get('/times', function(request, response) { - var result = '' - var times = process.env.TIMES || 5 - for (i=0; i < times; i++) - result += i + ' '; - response.send(result); +app.get('/search', function(request, response) { + response.render('pages/search', { + title: 'Search - Open Fixture Library' + }); }); -app.listen(app.get('port'), function() { - console.log('Node app is running on port', app.get('port')); +app.get('/manufacturers', function(request, response) { + response.render('pages/manufacturers', { + title: 'Manufacturers - Open Fixture Library' + }); }); +app.get('/categories', function(request, response) { + response.render('pages/categories', { + title: 'Categories - Open Fixture Library' + }); +}); +app.listen(app.get('port'), function() { + console.log('Node app is running on port', app.get('port')); +}); diff --git a/public/lang-logo.png b/public/lang-logo.png deleted file mode 100644 index e8a2e8b0f7aa3126f56dbb8c3514a11b64023a18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2293 zcmb8x`6CmI1IO`|Yt1=wWRAvM$wL{-v1p@_BWDTWt2vealyf5iTOK*2vBHl5@0 zheHug7!;tkPhk!K0Me~3&biSx+JX1=-BA!zO8Q;u^s(1N;#mfh&vI}e}}UC zmbW+cy)nRS_RbRWThsSUs6UOQ)t7e%jx z<{vtBCyNwQSihv>s$nr9w?xXxe6OTFl&hnL(uWH=ns6ky6t6SNsB3 zmu7_Rua>v*`qt)L-@0-jm)=$Nru7H9{8bzV>Q4dd8PNqFY;sDwkp8;hIvcMUgxy>C zO&A;41I3O71U3&AL_N_$qi4R>0a3IWF0#&g;ua3S53l0uOQIadjuC={-iDWJV+vHw zA)U=oZ0t0_sCxJpYsN`Q^egx*DIbYxv44Hk3r+h}CLH-mvOyQ9xxteYl@q$Bs#BD7 z;Ajx|IkVyuPB~w(vLSb(qu8Tjw<#_W_ho2hWKbeuL6gj4yz5#~+cGRqKUt`HM29yK z^l_YtF~lrZjmEQT`9_H$16Z>c#Ci4m90Q9!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Lom|1d;ynxZQw^y}_%Won&=NJHA(-_|m#nn) z_#cxMUt=$i09X1sN=7>wBQ)0UdRSI{*x1 W{LbprEX)4WF#u~zdy86>PyE0AE>_wA diff --git a/public/node.svg b/public/node.svg deleted file mode 100644 index ccd6395763..0000000000 --- a/public/node.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - diff --git a/public/style.css b/public/style.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css deleted file mode 100644 index 2d1ee1b0de..0000000000 --- a/public/stylesheets/main.css +++ /dev/null @@ -1,27 +0,0 @@ -.jumbotron { - background: #532F8C; - color: white; - padding-bottom: 80px; } - .jumbotron .btn-primary { - background: #845ac7; - border-color: #845ac7; } - .jumbotron .btn-primary:hover { - background: #7646c1; } - .jumbotron p { - color: #d9ccee; - max-width: 75%; - margin: 1em auto 2em; } - .navbar + .jumbotron { - margin-top: -20px; } - .jumbotron .lang-logo { - display: block; - background: #B01302; - border-radius: 50%; - overflow: hidden; - width: 100px; - height: 100px; - margin: auto; - border: 2px solid white; } - .jumbotron .lang-logo img { - max-width: 100%; } - diff --git a/views/pages/about.ejs b/views/pages/about.ejs new file mode 100644 index 0000000000..926a9cda8c --- /dev/null +++ b/views/pages/about.ejs @@ -0,0 +1,6 @@ +<% include ../partials/header.ejs %> + +

About

+

Open Fixture Library is a project by Florian Edelmann. It is open source (licensed under GPL-3) and everybody is invited to contribute!

+ +<% include ../partials/footer.ejs %> \ No newline at end of file diff --git a/views/pages/categories.ejs b/views/pages/categories.ejs new file mode 100644 index 0000000000..4fd0f7bdfe --- /dev/null +++ b/views/pages/categories.ejs @@ -0,0 +1,6 @@ +<% include ../partials/header.ejs %> + +

Categories

+

list of all categories

+ +<% include ../partials/footer.ejs %> \ No newline at end of file diff --git a/views/pages/db.ejs b/views/pages/db.ejs deleted file mode 100644 index 8fa88f8300..0000000000 --- a/views/pages/db.ejs +++ /dev/null @@ -1,24 +0,0 @@ - - - - <% include ../partials/header.ejs %> - Database - - - - -<% include ../partials/nav.ejs %> - -
-

Database Results

- -
    - <% results.forEach(function(r) { %> -
  • <%= r.id %> - <%= r.name %>
  • - <% }); %> -
- -
- - - diff --git a/views/pages/index.ejs b/views/pages/index.ejs index d8b28a8755..655ee2e5bd 100644 --- a/views/pages/index.ejs +++ b/views/pages/index.ejs @@ -1,67 +1,6 @@ - - - - <% include ../partials/header.ejs %> - Open Fixture Library - +<% include ../partials/header.ejs %> - +

Open fixture library

+

Home page

- <% include ../partials/nav.ejs %> - -
-
- -

Open Fixture Library

-

This is a sample Node application deployed to Heroku. It's a reasonably simple app - but a good foundation for understanding how to get the most out of the Heroku platform.

- Getting Started with Node - Source on GitHub -
-
-
- -
-
-
-

How this sample app works

-
    -
  • This app was deployed to Heroku, either using Git or by using Heroku Button on the repository.
  • - -
  • When Heroku received the source code, it fetched all the dependencies in the package.json, creating a deployable slug.
  • -
  • The platform then spins up a dyno, a lightweight container that provides an isolated environment in which the slug can be mounted and executed.
  • -
  • You can scale your app, manage it, and deploy over 150 add-on services, from the Dashboard or CLI.
  • -
-
-
-

Next Steps

-
    -
  • If you are following the Getting Started guide, then please head back to the tutorial and follow the next steps!
  • -
  • If you deployed this app by deploying the Heroku Button, then in a command line shell, run:
  • -
      -
    • git clone https://github.com/heroku/node-js-getting-started.git - this will create a local copy of the source code for the app
    • -
    • cd node-js-getting-started - change directory into the local source code repository
    • -
    • heroku git:remote -a <your-app-name> - associate the Heroku app with the repository
    • -
    • You'll now be set up to run the app locally, or deploy changes to Heroku
    • -
    -
-

Helpful Links

- -
-
- -
- - - - +<% include ../partials/footer.ejs %> \ No newline at end of file diff --git a/views/pages/manufacturers.ejs b/views/pages/manufacturers.ejs new file mode 100644 index 0000000000..667d4d732a --- /dev/null +++ b/views/pages/manufacturers.ejs @@ -0,0 +1,6 @@ +<% include ../partials/header.ejs %> + +

Manufacturers

+

list of all manufacturers

+ +<% include ../partials/footer.ejs %> \ No newline at end of file diff --git a/views/pages/search.ejs b/views/pages/search.ejs new file mode 100644 index 0000000000..a42e639c14 --- /dev/null +++ b/views/pages/search.ejs @@ -0,0 +1,6 @@ +<% include ../partials/header.ejs %> + +

Search

+

search results

+ +<% include ../partials/footer.ejs %> \ No newline at end of file diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs new file mode 100644 index 0000000000..691287b6e3 --- /dev/null +++ b/views/partials/footer.ejs @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/views/partials/header.ejs b/views/partials/header.ejs index 8635e88e46..d0c1179cd4 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -1,4 +1,22 @@ - - - - + + + + +<%= title %> + + + +
+ + +
+ + +
+ + +
\ No newline at end of file diff --git a/views/partials/nav.ejs b/views/partials/nav.ejs deleted file mode 100644 index 224b5e7c6c..0000000000 --- a/views/partials/nav.ejs +++ /dev/null @@ -1,33 +0,0 @@ -