Remove features that were not working: Metadata, export button and reloading the website from the website itself
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
|
||||
/* Metadata popup */
|
||||
.metadata-popup {
|
||||
background: var(--card-bg);
|
||||
background: var(--card-background);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||
|
||||
+1
-12
@@ -328,8 +328,6 @@ def main(clean_first: bool = False) -> None:
|
||||
else:
|
||||
print(f"Warning: Assets directory {assets_src} not found")
|
||||
|
||||
plot_metadata_cache = {}
|
||||
|
||||
for source in CONFIG.sources:
|
||||
source_path = Path(source.path)
|
||||
|
||||
@@ -359,21 +357,12 @@ def main(clean_first: bool = False) -> None:
|
||||
else:
|
||||
print(f"Skipping {source_png_path.name} (up to date)")
|
||||
|
||||
# Resolve metadata for this single plot
|
||||
plot_metadata = resolve_metadata_for_plot(source_path, {})
|
||||
plot_metadata_cache[source_path.stem] = plot_metadata
|
||||
|
||||
items = [{
|
||||
"name": source_path.stem,
|
||||
"pdf_href": pdf_name,
|
||||
"png_href": png_name,
|
||||
"metadata": plot_metadata
|
||||
"png_href": png_name
|
||||
}]
|
||||
|
||||
# Save metadata cache for this directory
|
||||
plot_cache = {source_path.stem: plot_metadata}
|
||||
save_metadata_cache(source_web_dir, plot_cache)
|
||||
|
||||
# Calculate statistics for single file
|
||||
current_stats = calculate_directory_stats(source_web_dir)
|
||||
stats = {
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Simple CGI script to refresh the gallery.
|
||||
Just calls the main generate_gallery.py script.
|
||||
"""
|
||||
|
||||
import subprocess
|
||||
|
||||
|
||||
def main():
|
||||
# Output HTTP headers
|
||||
print("Content-Type: text/plain")
|
||||
print("Cache-Control: no-cache")
|
||||
print() # Empty line to end headers
|
||||
|
||||
try:
|
||||
# Call the gallery generation script
|
||||
result = subprocess.run(
|
||||
[
|
||||
"python3",
|
||||
"/work/kschmidt/web/generate_gallery.py"
|
||||
],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=300,
|
||||
)
|
||||
|
||||
if result.returncode == 0:
|
||||
print("Gallery refresh successful!")
|
||||
print("\nOutput:")
|
||||
print(result.stdout)
|
||||
if result.stderr:
|
||||
print("\nWarnings:")
|
||||
print(result.stderr)
|
||||
else:
|
||||
print(f"Gallery refresh failed with return code "
|
||||
f"{result.returncode}")
|
||||
print("\nError output:")
|
||||
print(result.stderr)
|
||||
if result.stdout:
|
||||
print("\nStandard output:")
|
||||
print(result.stdout)
|
||||
|
||||
except subprocess.TimeoutExpired:
|
||||
print("Gallery refresh timed out after 5 minutes")
|
||||
except Exception as e:
|
||||
print(f"Error running gallery refresh: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -41,11 +41,7 @@
|
||||
<a href="{{ item.pdf_href }}">
|
||||
<img src="{{ item.png_href }}" alt="{{ item.name }}">
|
||||
</a>
|
||||
<button class="metadata-btn"
|
||||
data-plot-name="{{ item.name|e }}"
|
||||
data-metadata="{{ item.metadata|tojson|e if item.metadata is not none and item.metadata|length > 0 else '{}' }}"
|
||||
onclick="event.stopPropagation(); showMetadataPopup(this, this.dataset.plotName, JSON.parse(this.dataset.metadata))"
|
||||
title="View metadata">
|
||||
<button class="metadata-btn" onclick="event.stopPropagation(); showMetadataPopup(this, '{{ item.name|e }}', {{ (item.metadata or {})|tojson }})" title="View metadata">
|
||||
⋯
|
||||
</button>
|
||||
<div class="plot-name" title="{{ item.name }}">{{ item.name }}</div>
|
||||
|
||||
Reference in New Issue
Block a user