Move css to a separate file, serve static files under /static/ route
This commit is contained in:
@@ -9,12 +9,13 @@ import requests
|
|||||||
import os
|
import os
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
from bottle import hook, request, route, run, view
|
from bottle import hook, request, route, run, static_file, view
|
||||||
|
|
||||||
from config import conf
|
from config import conf
|
||||||
import models
|
import models
|
||||||
from models import Song, AirCast, DoesNotExist
|
from models import Song, AirCast, DoesNotExist
|
||||||
|
|
||||||
|
project_dir = os.path.dirname(__file__)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Util functions
|
# Util functions
|
||||||
@@ -112,6 +113,11 @@ def results_page():
|
|||||||
start_time=time,
|
start_time=time,
|
||||||
end_time = '{:0>2}:00'.format(hour+1))
|
end_time = '{:0>2}:00'.format(hour+1))
|
||||||
|
|
||||||
|
@route('/static/<filename>')
|
||||||
|
def serve_static_file(filename):
|
||||||
|
static_root = os.path.join(project_dir, 'static')
|
||||||
|
return static_file(filename, root=static_root)
|
||||||
|
|
||||||
@hook('before_request')
|
@hook('before_request')
|
||||||
def set_locale():
|
def set_locale():
|
||||||
"""Set the locale for all categories to the first lang in Accept-Language
|
"""Set the locale for all categories to the first lang in Accept-Language
|
||||||
|
|||||||
19
static/balises.css
Normal file
19
static/balises.css
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#results {
|
||||||
|
border-colapse: collapse;
|
||||||
|
}
|
||||||
|
#results td, #results th {
|
||||||
|
padding-top: 3px;
|
||||||
|
padding-bottom: 3px;
|
||||||
|
padding-right:15px;
|
||||||
|
}
|
||||||
|
#results tr:hover {
|
||||||
|
background-color: #eaeaea;
|
||||||
|
}
|
||||||
|
#results a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
#results .fa-youtube {
|
||||||
|
/*color: #ed4337;*/
|
||||||
|
color: crimson;
|
||||||
|
}
|
||||||
@@ -2,27 +2,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Radio Balises</title>
|
<title>Radio Balises</title>
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
||||||
|
<link rel="stylesheet" href="static/balises.css">
|
||||||
<style>
|
|
||||||
#results {
|
|
||||||
border-colapse: collapse;
|
|
||||||
}
|
|
||||||
#results td, #results th {
|
|
||||||
padding-top: 3px;
|
|
||||||
padding-bottom: 3px;
|
|
||||||
padding-right:15px;
|
|
||||||
}
|
|
||||||
#results tr:hover {
|
|
||||||
background-color: #eaeaea;
|
|
||||||
}
|
|
||||||
#results a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
|
||||||
}
|
|
||||||
#results .fa-youtube {
|
|
||||||
color:red;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form action="/" method="post" id="datetime_form">
|
<form action="/" method="post" id="datetime_form">
|
||||||
|
|||||||
Reference in New Issue
Block a user