Skip to content

Commit

Permalink
Flask webserver: templates
Browse files Browse the repository at this point in the history
  • Loading branch information
filipsPL committed Nov 25, 2018
1 parent 29f56fd commit 07750e1
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 10 deletions.
9 changes: 1 addition & 8 deletions autowx2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@
from autowx2_conf import * # configuration
from autowx2_functions import * # all functions and magic hidden here

from flask import Flask, render_template
from threading import Thread


app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
from autowx2_webserver import *

# ------------------------------------------------------------------------------------------------------ #

Expand Down
3 changes: 1 addition & 2 deletions autowx2_functions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-

#
# autowx2 - genpastable.py
# generates the pass table and recording plan for tne next few days and the appropriate plot
# autowx2 - function and classes used by autowx2 and auxiliary programs
#
# GANTT Chart with Matplotlib
# Sukhbinder
Expand Down
24 changes: 24 additions & 0 deletions autowx2_webserver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-

#
# autowx2 - webserver definitions


# configuration
from autowx2_conf import *

from flask import Flask, render_template
from threading import Thread

# satellites = list(satellitesData)
# qth = (stationLat, stationLon, stationAlt)



app = Flask(__name__, template_folder="var/flask/templates/", static_folder='var/flask/static') # " template_folder="var/flask/templates/"

body="hello!"

@app.route('/')
def homepage():
return render_template('index.html', body=body)
7 changes: 7 additions & 0 deletions var/flask/static/bootstrap.bundle.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions var/flask/static/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions var/flask/static/fancybox/jquery.fancybox.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions var/flask/static/fancybox/jquery.fancybox.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions var/flask/static/fancybox/source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/fancyapps/fancyBox
2 changes: 2 additions & 0 deletions var/flask/static/jquery.min.js

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions var/flask/static/logo-nav.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*!
* Start Bootstrap - Logo Nav (https://startbootstrap.com/template-overviews/logo-nav)
* Copyright 2013-2017 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-logo-nav/blob/master/LICENSE)
*/

body {
padding-top: 94px;
}

@media (min-width: 992px) {
body {
padding-top: 76px;
}
}


h2 {
padding-top: 16px;
}

img { padding: 10px;}

h2:after
{
content:' ';
display:block;
border:1px dotted silver;

}
67 changes: 67 additions & 0 deletions var/flask/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">

<head>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="autowx2 atomated satellite receiving station">
<meta name="author" content="filipsPL@github">

<title>autowx2 atomated satellite receiving station :: $htmlTitle</title>

<!-- Bootstrap core CSS -->
<link href="{{ url_for('static',filename='bootstrap.min.css') }}" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="{{ url_for('static',filename='logo-nav.css') }}" rel="stylesheet">


<link href="{{ url_for('static',filename='fancybox/jquery.fancybox.min.css') }}" rel="stylesheet">

</head>

<body>

<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="/">
autowx2 | automatic receiving station
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="/">Home
<span class="sr-only">(current)</span>
</a>
</li>
<a class="nav-link" href="/table.html">Pass table
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/filipsPL/autowx2">Source code</a>
</li>
</ul>
</div>
</div>
</nav>

<!-- Page Content -->
<div class="container">

{{ body }}
</div>
<!-- /.container -->

<!-- Bootstrap core JavaScript -->
<script src="{{ url_for('static',filename='jquery.min.js') }}"></script>
<script src="{{ url_for('static',filename='bootstrap.bundle.min.js') }}"></script>
<script src="{{ url_for('static',filename='fancybox/jquery.fancybox.min.js') }}"></script>

</body>

</html>

0 comments on commit 07750e1

Please sign in to comment.