Add favicon and fix version display and navbar spacing
ci/woodpecker/push/woodpecker Pipeline failed Details

This commit is contained in:
colin 2025-07-03 13:26:41 -04:00
parent b9a33344c4
commit feab8c2ca0
4 changed files with 29 additions and 3 deletions

View File

@ -14,10 +14,16 @@ RUN apt-get update && apt-get install -y \
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# Copy VERSION file
COPY ../VERSION ./VERSION
ARG APP_VERSION=unknown
ENV APP_VERSION=${APP_VERSION}
# Copy application code # Copy application code
COPY app.py . COPY app.py .
COPY schema.sql . COPY schema.sql .
COPY templates/ ./templates/ COPY templates/ ./templates/
COPY static/ ./static/
# Tests directory is empty or doesn't contain required files # Tests directory is empty or doesn't contain required files
# COPY tests/ ./tests/ # COPY tests/ ./tests/

View File

@ -18,8 +18,14 @@ logger = logging.getLogger('ploughshares')
VERSION = os.environ.get('APP_VERSION') VERSION = os.environ.get('APP_VERSION')
if not VERSION: if not VERSION:
try: try:
with open(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'VERSION'), 'r') as f: # Try to read from VERSION file in the current directory first
VERSION = f.read().strip() if os.path.exists('VERSION'):
with open('VERSION', 'r') as f:
VERSION = f.read().strip()
# Fall back to the project root VERSION file
else:
with open(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'VERSION'), 'r') as f:
VERSION = f.read().strip()
except: except:
VERSION = "unknown" VERSION = "unknown"

View File

@ -0,0 +1,7 @@
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

View File

@ -4,6 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Project Ploughshares - Transaction Management System{% endblock %}</title> <title>{% block title %}Project Ploughshares - Transaction Management System{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='favicon.ico') }}">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css">
<style> <style>
@ -54,6 +55,12 @@
font-size: 0.8em; font-size: 0.8em;
color: #999; color: #999;
} }
.navbar-nav {
gap: 1rem;
}
.nav-item {
margin: 0 0.5rem;
}
</style> </style>
</head> </head>
<body> <body>
@ -68,7 +75,7 @@
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse" id="navbarNav"> <div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav"> <ul class="navbar-nav ms-auto">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ url_for('index') }}">Home</a> <a class="nav-link" href="{{ url_for('index') }}">Home</a>
</li> </li>