From 15087ca30f1dda8439f2037fb49e13205ef794c4 Mon Sep 17 00:00:00 2001 From: Garrett Mills Date: Fri, 21 Jun 2019 17:54:10 -0500 Subject: [PATCH] UI improvements --- app/assets/dash_v1.css | 45 ++++++++++++++++++++++++++++++ app/controllers/Home.controller.js | 8 +++++- app/views/dash_v1/main.pug | 10 +++++-- app/views/dash_v1/out.pug | 10 +++++-- app/views/dash_v1/project.pug | 1 + app/views/dash_v1/view.pug | 10 +++---- app/views/welcome.pug | 7 +++-- 7 files changed, 77 insertions(+), 14 deletions(-) diff --git a/app/assets/dash_v1.css b/app/assets/dash_v1.css index fb5c7a9..ffd882d 100644 --- a/app/assets/dash_v1.css +++ b/app/assets/dash_v1.css @@ -1,3 +1,10 @@ +@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro'); +@import url('https://fonts.googleapis.com/css?family=Source+Code+Pro'); + +html { + font-family: "Source Sans Pro"; +} + table, th, td { border: 1px solid #cccccc; } @@ -7,4 +14,42 @@ th, td { padding-bottom: 5px; padding-left: 10px; padding-right: 10px; +} + +pre, code { + font-family: "Source Code Pro"; + font-size: 10pt; +} + +a { + color: #004d4d; +} + +.navul { + list-style-type: none; + margin: 0; + padding: 5; + margin-bottom: 20px; +} + +.navli { + display: inline; + background: #eee; + border-radius: 7px; + margin-right: 10px; + transition: all 0.5s ease; +} + +.navli:hover { + background: #004d4d; +} + +.nava { + text-decoration: none; + padding: 20; + transition: all 0.5s ease; +} + +.nava:hover { + color: #eee; } \ No newline at end of file diff --git a/app/controllers/Home.controller.js b/app/controllers/Home.controller.js index 115c797..df772a6 100644 --- a/app/controllers/Home.controller.js +++ b/app/controllers/Home.controller.js @@ -11,13 +11,19 @@ class Home { */ welcome(req, res){ + let pass = {} + + if ( req.session.auth && req.session.auth.user ){ + pass['user'] = req.session.auth.user + } + /* * Return the welcome view. * It must be passed the response. * View parameters can be passed as an optional third * argument to the view() method. */ - return _flitter.view(res, 'welcome') + return _flitter.view(res, 'welcome', pass) } } diff --git a/app/views/dash_v1/main.pug b/app/views/dash_v1/main.pug index e843086..21d09f6 100644 --- a/app/views/dash_v1/main.pug +++ b/app/views/dash_v1/main.pug @@ -4,9 +4,9 @@ html link(rel='stylesheet' href='/assets/dash_v1.css') body h1 DevBug Dashboard - ul(style='list-style-type: none; display: inline; margin: 0; padding: 0; padding-right: 15px;') - li - a(href='/auth/logout') Logout + ul.navul + li.navli + a.nava(href='/auth/logout') Logout h3 My Projects ul(style='list-style-type: none;') li @@ -24,3 +24,7 @@ html ul(style='list-style-type: none; margin: 0; padding: 0;') li a.action(href='/dash/v1/project/view/'+project.id) View + li + a.action(href='/dash/v1/project/delete/'+project.id) Delete + li + a.action(href='/dash/v1/project/edit/'+project.id) Edit diff --git a/app/views/dash_v1/out.pug b/app/views/dash_v1/out.pug index 76f1829..b65dee7 100644 --- a/app/views/dash_v1/out.pug +++ b/app/views/dash_v1/out.pug @@ -1,10 +1,16 @@ html head title #{out.brief} + link(rel='stylesheet' href='/assets/dash_v1.css') body h2 #{out.brief} - div - a(href='javascript:window.history.back()') Back + ul.navul + li.navli + a.nava(href='/dash/v1') Dashboard + li.navli + a.nava(href='javascript:window.history.back()') Back + li.navli + a.nava(href='/auth/logout') Logout pre code div #{prettyd} \ No newline at end of file diff --git a/app/views/dash_v1/project.pug b/app/views/dash_v1/project.pug index cbaf2aa..ae49b7e 100644 --- a/app/views/dash_v1/project.pug +++ b/app/views/dash_v1/project.pug @@ -1,6 +1,7 @@ html head title #{(update ? 'Update Project' : 'Create New Project')} | DevBug + link(rel='stylesheet' href='/assets/dash_v1.css') body h2 #{(update ? 'Update Project' : 'Create New Project')} if errors diff --git a/app/views/dash_v1/view.pug b/app/views/dash_v1/view.pug index ce87b1b..9db5a59 100644 --- a/app/views/dash_v1/view.pug +++ b/app/views/dash_v1/view.pug @@ -5,11 +5,11 @@ html body h2 View: #{project.name} h4 API Key: #{ project.uuid } - ul(style='list-style-type: none; display: inline; margin: 0; padding: 0; padding-right: 15px;') - li - a(href='/dash/v1') Dashboard - li - a(href='/auth/logout') Logout + ul.navul + li.navli + a.nava(href='/dash/v1') Dashboard + li.navli + a.nava(href='/auth/logout') Logout table thead tr diff --git a/app/views/welcome.pug b/app/views/welcome.pug index f9480d6..e7ce7de 100644 --- a/app/views/welcome.pug +++ b/app/views/welcome.pug @@ -1,6 +1,6 @@ html head - title Flitter + title Welcome | DevBug style(type="text/css"). @import url('https://fonts.googleapis.com/css?family=Rajdhani'); html, @@ -34,7 +34,8 @@ html margin-left: 35px; color: #00323d; } -body + body .flitter-container img.flitter-image(src="/assets/flitter.png") - p.flitter-name powered by flitter \ No newline at end of file + p.flitter-name devbug + a.flitter-name(style='font-size: 20pt; text-decoration: none;' href='/dash/v1') Dashboard \ No newline at end of file