Skip to content

Feature/configurable template#93

Open
SilviaSWR wants to merge 2 commits intorexzhang:mainfrom
SilviaSWR:feature/configurable-template
Open

Feature/configurable template#93
SilviaSWR wants to merge 2 commits intorexzhang:mainfrom
SilviaSWR:feature/configurable-template

Conversation

@SilviaSWR
Copy link
Copy Markdown
Contributor

Checklist

  • I have read the contribution guidelines
  • One Feature(issue) One PR
  • All commits in the PR will be merged into a single commit.
  • Add an entry in changelog.en.md if necessary
  • Add my name and GitHub profile link
  • Add / update tests if necessary
  • Add new / update outdated documentation

Description

This PR introduces support for configurable HTML templates for the directory browser page, replacing the previous hardcoded HTML generation.

The goal is to decouple presentation from backend logic and allow full UI customization without modifying core server code.

Changes

  • Introduced template-based rendering for directory listing
  • Removed hardcoded HTML generation for directory browser
  • Added support for external template file configuration
  • Exposed context variables to templates:
    • path
    • parent
    • items
    • version
    • current_time

Features enabled

This change allows deployments to fully customize the directory browser UI, including:

  • Custom CSS styling via external stylesheets
  • Use of images and logos (via static assets)
  • Full layout and branding customization
  • Custom footers and acknowledgments without code changes

fixes #91

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.11%. Comparing base (412893d) to head (0b8e9b0).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
asgi_webdav/web_dav.py 25.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #93      +/-   ##
==========================================
+ Coverage   76.00%   76.11%   +0.11%     
==========================================
  Files          26       26              
  Lines        3775     3772       -3     
==========================================
+ Hits         2869     2871       +2     
+ Misses        906      901       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SilviaSWR
Copy link
Copy Markdown
Contributor Author

This contribution has received funding from the Spanish government (grant EQC2021-007479-P, funded by MCIN/AEI/10.13039/501100011033), the EU NextGeneration/PRTR (PRTR-C17.I1), and the Generalitat de Catalunya.

@@ -0,0 +1,70 @@
body {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not add any styles extra style, just keep the styles that were already present in the default template.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this:

    table {{ table-layout: auto;width: 100%; }}
    tbody tr:nth-of-type(even) {{ background-color: #f3f3f3; }}
    .align-left {{ text-align: left; }}
    .align-right {{ text-align: right; }}

Comment thread docs/acknowledgements.md
## PIC
## [PIC](https://www.pic.es)

(1) This contribution has received funding from the Spanish government (grant EQC2021-007479-P, funded by MCIN/AEI/10.13039/501100011033), the EU
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change (1) with the PR number/link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: support configurable templates for HTML directory listing

2 participants