Skip to content

Commit

Permalink
Merge pull request #347 from alercebroker/fix/htmx-response
Browse files Browse the repository at this point in the history
Change HTMX to a lower version
  • Loading branch information
Demurest authored Jan 7, 2025
2 parents 91b3d8f + 1ee0096 commit 261c700
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script id="htmx-script" src="https://unpkg.com/htmx.[email protected]"></script>
<script src="{{API_URL}}/htmx/htmx.min.js"></script>
<meta name="htmx-config" content='{"selfRequestsOnly": false}'>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0">
<link rel="stylesheet" href="{{API_URL}}/static/crossmatch.css">
Expand Down
1 change: 1 addition & 0 deletions lightcurve/src/htmx/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The HTMX version is the 1.9.12
1 change: 1 addition & 0 deletions lightcurve/src/htmx/htmx.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lightcurve/src/lightcurve_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
name="static",
)

app.mount(
"/htmx", StaticFiles(directory="src/htmx"), name="htmx"
)

@app.get("/openapi.json")
def custom_swagger_route():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script id="htmx-script" src="https://unpkg.com/htmx.[email protected]"></script>
<script src="{{API_URL}}/htmx/htmx.min.js"></script>
<meta name="htmx-config" content='{"selfRequestsOnly": false}'>
<link rel="stylesheet" href="{{ API_URL }}/static/main.css">
<script>
Expand Down
3 changes: 3 additions & 0 deletions lightcurve/src/magstats_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"/static", StaticFiles(directory="src/magstats_api/static"), name="static"
)

app.mount(
"/htmx", StaticFiles(directory="src/htmx"), name="htmx"
)

@app.get("/openapi.json")
def custom_swagger_route():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script id="htmx-script" src="https://unpkg.com/htmx.[email protected]"></script>
<script src="{{API_URL}}/htmx/htmx.min.js"></script>
<meta name="htmx-config" content='{"selfRequestsOnly": false}'>
<script type="module" src="{{API_URL}}/static/magstats.js"></script>
<link rel="stylesheet"
Expand Down
3 changes: 3 additions & 0 deletions lightcurve/src/object_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"/static", StaticFiles(directory="src/object_api/static"), name="static"
)

app.mount(
"/htmx", StaticFiles(directory="src/htmx"), name="htmx"
)

@app.get("/openapi.json")
def custom_swagger_route():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script id="htmx-script" src="https://unpkg.com/htmx.[email protected]"></script>
<meta name="htmx-config" content='{"selfRequestsOnly": false}'
<script src="{{API_URL}}/htmx/htmx.min.js"></script>
<meta name="htmx-config" content='{"selfRequestsOnly": false}'>
<script type="module" src="{{API_URL}}/static/object.js"></script>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0">
Expand Down
4 changes: 3 additions & 1 deletion lightcurve/src/probability_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
app.include_router(prefix="/htmx", router=htmx.router)

app.mount("/static", StaticFiles(directory="src/probability_api/static"), name="static")

app.mount(
"/htmx", StaticFiles(directory="src/htmx"), name="htmx"
)

@app.get("/openapi.json")
def custom_swagger_route():
Expand Down
3 changes: 2 additions & 1 deletion lightcurve/src/probability_api/templates/prob.html.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script id="htmx-script" src="https://unpkg.com/[email protected]"></script>
<script src="{{API_URL}}/htmx/htmx.min.js"></script>
<meta name="htmx-config" content='{"selfRequestsOnly": false}'>
<script type="module" src="{{API_URL}}/static/probability.js"></script>
<link rel="stylesheet" href="{{API_URL}}/static/probability.css">

Expand Down

0 comments on commit 261c700

Please sign in to comment.