diff --git a/app.py b/app.py
index 407abb2..50b7279 100644
--- a/app.py
+++ b/app.py
@@ -74,7 +74,7 @@ scheduler.add_job(generate_all_thumbnails, 'date', run_date=datetime.now()) # R
@app.route('/')
def index():
- return render_template('index.html')
+ return render_template('index.html', accent_color=config['appearance']['accent_color'])
@app.route('/api/images')
def get_images():
@@ -116,7 +116,7 @@ def admin():
photos = db_session.query(Photo).order_by(Photo.date_taken.desc()).all()
db_session.close()
- return render_template('admin.html', photos=photos)
+ return render_template('admin.html', photos=photos, accent_color=config['appearance']['accent_color'])
@app.route('/admin/login', methods=['GET', 'POST'])
def admin_login():
@@ -126,7 +126,7 @@ def admin_login():
return redirect(url_for('admin'))
else:
flash('Invalid password')
- return render_template('admin_login.html')
+ return render_template('admin_login.html', accent_color=config['appearance']['accent_color'])
@app.route('/admin/upload', methods=['POST'])
def admin_upload():
@@ -183,7 +183,7 @@ def admin_upload():
orientation=int(exif.get('Orientation', 1)),
width=width,
height=height,
- highlight_color=get_highlight_color(THUMBNAIL_FOLDER + f"{os.path.splitext(filename)[0]}/256_{filename}")
+ highlight_color=get_highlight_color(THUMBNAIL_FOLDER + f"/{os.path.splitext(filename)[0]}/256_{filename}")
)
db_session.add(new_photo)
db_session.commit()
diff --git a/config.py b/config.py
index b929a5b..0c5b9a7 100644
--- a/config.py
+++ b/config.py
@@ -14,6 +14,9 @@ def load_or_create_config():
'directories': {
'upload': 'uploads',
'thumbnail': 'thumbnails'
+ },
+ 'appearance': {
+ 'accent_color': '{{ accent_color }}'
}
}
with open(CONFIG_FILE, 'w') as f:
diff --git a/templates/admin.html b/templates/admin.html
index ae11af1..f54bde2 100644
--- a/templates/admin.html
+++ b/templates/admin.html
@@ -3,56 +3,146 @@
- Admin Interface
+ Admin Interface - Tanishq Dubey Photography
+
+
+
- Admin Interface
- {% with messages = get_flashed_messages() %}
- {% if messages %}
-
- {% for message in messages %}
- - {{ message }}
+
+
+
Admin Interface
+ {% with messages = get_flashed_messages() %}
+ {% if messages %}
+
+ {% for message in messages %}
+
{{ message }}
+ {% endfor %}
+
+ {% endif %}
+ {% endwith %}
+
+
Upload New Image
+
+
+
Uploaded Images
+
+
+
+ Thumbnail |
+ Filename |
+ Date Taken |
+ Focal Length |
+ Aperture |
+ Shutter Speed |
+ ISO |
+ Dimensions |
+
+
+
+ {% for photo in photos %}
+
+ |
+ {{ photo.input_filename }} |
+ {{ photo.date_taken.strftime('%Y-%m-%d %H:%M:%S') }} |
+ {{ photo.focal_length }} |
+ {{ photo.aperture }} |
+ {{ photo.shutter_speed }} |
+ {{ photo.iso }} |
+ {{ photo.width }}x{{ photo.height }} |
+
{% endfor %}
-
- {% endif %}
- {% endwith %}
- Upload New Image
-
- Uploaded Images
-
-
- ID |
- Thumbnail |
- Filename |
- Date Taken |
- Technical Info |
-
- {% for photo in photos %}
-
- {{ photo.id }} |
- |
- {{ photo.input_filename }} |
- {{ photo.date_taken.strftime('%Y-%m-%d %H:%M:%S') }} |
- {{ photo.focal_length }}mm f/{{ photo.aperture }} {{ photo.shutter_speed }}s ISO{{ photo.iso }} |
-
- {% endfor %}
-
+
+
+