revamped front end, removed absolute pathing, reorganized code

This commit is contained in:
JesseBot 2016-01-03 19:13:35 +00:00
parent 79efddb900
commit f818d92cd6
40 changed files with 156 additions and 214 deletions

4
.gitignore vendored
View file

@ -1,6 +1,4 @@
terminal
terminal/*
option.tpl
legacy/*
legacy
config/config.yaml
config.yaml

View file

@ -1,8 +1,8 @@
bootstrap_bottle
================
Keeping track of "best practices" aka things that work with bottle (Python webframework) and bootstrap (Twitter's frontend).
Keeping track of "best practices": things that work with bottle (Python webframework) and bootstrap (Twitter's frontend).
The website is located at dev.jessebot.com. Apache is serving vis mod_wsgi. Wsgi file commited.
The website is located at http://jessebot.com.
The socket file (CentOS/RHEL) is in /var/run.

View file

@ -1,2 +0,0 @@
Globals:
web_root: '<insert dir here>'

View file

@ -0,0 +1,2 @@
Globals:
web_root: 'PLACE ABSOLUTE PATH TO WEB ROOT HERE'

11
css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

View file

@ -1,22 +0,0 @@
body {
padding-top: 30px;
}
.starter-template {
padding: 40px 50px;
text-align: center;
}
.center {
float: none;
margin-left: auto;
margin-right: auto;
}
.rotate90 {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-o-transform: rotate(90deg);
-ms-transform: rotate(90deg);
transform: rotate(90deg);
}

11
front_end/css/bootstrap.min.css vendored Executable file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
.padMe {
padding: 0px 80px 0px 80px;
}
.col-md-5.tinyPad {
padding-left: 50px;
}
.col-md-6.morePad {
padding-top: 8px;
}
.starter-template {
padding: 40px 25px 0px 0px;
text-align: center;
}
.center {
float: none;
margin-left: auto;
margin-right: auto;
}

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/x-icon" href="/images/favicon_jessebot.ico">
<title>JesseBot.com</title>
<!-- Custom styles for this template -->
<link href="css/starter-template.css" rel="stylesheet">
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="starter-template">

View file

@ -0,0 +1,76 @@
% include('header.tpl')
<br />
<br />
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
About
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<div class="row featurette">
<div class="col-md-5 tinyPad">
<img class="featurette-image img-responsive img-circle" src="/images/defcon23.JPG">
</div>
<div class="col-md-7">
<h2 class="featurette-heading"><br /><span class="text-muted">Hi, I'm</span> Jesse.</h2>
<p class="lead">I'm a DevOps Engineer that loves Linux, the internet, and Python.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
Resume and GitHub
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<div class="row padMe">
<div class="col-md-6 morePad">
<img src="/images/docs.png">
<div class="btn-group">
<a href="https://docs.google.com/document/d/1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc/edit?pli=1" class="btn btn-primary btn-lg">Resume</a>
<button type="button" class="btn btn-primary btn-lg dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="https://docs.google.com/document/d/1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc/export?format=pdf&id=1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc">Download .PDF</a></li>
<li class="divider"></li>
<li><a href="https://docs.google.com/document/d/1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc/export?format=docx&id=1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc">Download .Docx</a></li>
</ul>
</div>
</div>
<div class="col-md-6">
<p><img src="/images/githubcat.png"><a href="http://github.com/jessebot" class="btn btn-primary btn-lg" role="button">GitHub</a></p>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
Linux Newbie Class
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse">
<div class="panel-body">
<h2><p><img src="/images/penguin_copy.png"> <a href="http://howtonix.info" class="btn btn-primary btn-lg" role="button">How To *n?x</a></p></h2>
</div>
</div>
</div>
</div>
% include('footer.tpl')

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

View file

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 222 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 269 KiB

After

Width:  |  Height:  |  Size: 269 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1,010 KiB

After

Width:  |  Height:  |  Size: 1,010 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 2.8 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 237 KiB

After

Width:  |  Height:  |  Size: 237 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

View file

@ -1,17 +1,26 @@
# production jessebot.com python file
# production jessebot.com web routing bottle file
from lib import get_global_variable
import logging
from bottle import redirect, request, response, route
from bottle import run, static_file, template
import sys
import yaml
def get_global_variable(global_variable):
""" gets global variable given string variable name"""
with open('./config/config.yaml', 'r') as f:
doc = yaml.load(f)
txt = doc["Globals"][global_variable]
return txt
# grab web root
WEB_ROOT = get_global_variable('web_root')
# set logging
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
logging.info("logging config loaded")
# full path to HTML templates
bottle.TEMPLATE_PATH.insert(0,'{0}/front_end/html_templates/'.format(WEB_ROOT)
@route('/')
@ -19,21 +28,6 @@ def index():
return template('index')
@route('/contact')
def contact():
return template('contact')
@route('/about')
def about():
return template('about')
@route('/legacy')
def legacy():
redirect("http://legacy.jessebot.com")
@route('/hate')
def hate():
return template('hate')
@ -47,14 +41,14 @@ def photo():
@route('/images/<filename>')
def images(filename):
return static_file(filename, root='{0}/images'.format(WEB_ROOT))
return static_file(filename, root='{0}/front_end/images'.format(WEB_ROOT))
@route('/js/<filename>')
def js(filename):
return static_file(filename, root='{0}/js'.format(WEB_ROOT))
return static_file(filename, root='{0}/front_end/js'.format(WEB_ROOT))
@route('/css/<filename>')
def css(filename):
return static_file(filename, root='{0}/css'.format(WEB_ROOT))
return static_file(filename, root='{0}/front_end/css'.format(WEB_ROOT))

9
lib.py
View file

@ -1,9 +0,0 @@
import yaml
def get_global_variable(global_variable):
""" gets global variable given string variable name"""
with open('./config.yaml', 'r') as f:
doc = yaml.load(f)
txt = doc["Globals"][global_variable]
return txt

View file

@ -1,13 +0,0 @@
% include('header.tpl')
<div class="jumbotron">
<div class="row featurette">
<div class="col-md-5">
<img class="featurette-image img-responsive img-circle" src="/images/IMG_0014.JPG">
</div>
<div class="col-md-7">
<h2 class="featurette-heading">Hi, I'm<span class="text-muted"> Jesse.</span></h2>
<p class="lead">I'm a Linux systems engineer. I like traveling around the world and spending time with my dog. I spend most of my evenings playing videogames.</p>
</div>
</div>
</div>
% include('footer.tpl')

View file

@ -1,4 +0,0 @@
% include('header.tpl')
<h1>Trying to Make Contact?</h1>
<p class="lead">Personal chat? You can email me <a href="mailto:jessebot@linux.com">here</a>.<br /></p>
% include('footer.tpl')

View file

@ -1,47 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/x-icon" href="/images/favicon_jessebot.ico">
<title>JesseBot.com</title>
<!-- Custom styles for this template -->
<!--<link href="css/starter-template.css" rel="stylesheet">-->
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://jessebot.com">Jesse Hunt</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</div>
<div class="container">
<div class="starter-template">

View file

@ -1,79 +0,0 @@
% include('header.tpl')
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
Resume
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<img src="/images/docs.png"><div class="btn-group">
<a href="https://docs.google.com/document/d/1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc/edit?pli=1" class="btn btn-success btn-lg">Resume</a>
<button type="button" class="btn btn-success btn-lg dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="https://docs.google.com/document/d/1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc/export?format=pdf&id=1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc">Download .PDF</a></li>
<li class="divider"></li>
<li><a href="https://docs.google.com/document/d/1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc/export?format=docx&id=1t-xBYBxyUbDKUKQFIY1_r0GnjCMIUAyelfnyIhTK2Uc">Download .Docx</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
Github
</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse">
<div class="panel-body">
<div class="well well-sm"
<h2><p><img src="/images/gitkitty.png"> <a href="http://github.com/jessebot" class="btn btn-primary btn-lg" role="button">Github</a></p></h2>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
Linux Newbie Class
</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse">
<div class="panel-body">
<div class="well well-sm">
<h2><p><img src="/images/penguin_copy.png"> <a href="http://howtonix.info" class="btn btn-primary btn-lg" role="button">How To *n?x</a></p></h2>
</div>
</div>
</div>
</div>
<!-- <div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseFour">
Photography
</a>
</h4>
</div>
<div id="collapseFour" class="panel-collapse collapse">
<div class="panel-body">
<div class="well well-sm">
<h2><p><img src="/images/sillly.png"> <a href="http://photo.jessebot.com" class="btn btn-primary btn-lg" role="button">Photography</a></p></h2>
</div>
</div>
</div>
</div>-->
</div>
% include('footer.tpl')