SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 1cc9d8ff authored by George Katsikas's avatar George Katsikas :goat:
Browse files

feat(graphs): :sparkles: initialize plot options form through get params

parent 54bada0e
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@
class="col-12 col-lg-3 d-flex flex-column"
hx-post="{% url "graphs:explorer_plot_options_form" %}"
hx-sync="this:replace"
hx-trigger="load, change from:#plot-container"></div>
hx-trigger="change from:#plot-container">{% crispy form %}</div>
<div class="col d-flex flex-column">
<div id="plot"
......@@ -40,7 +40,7 @@
hx-get="{% url "graphs:explorer_plot" %}"
hx-params="not csrfmiddlewaretoken"
hx-sync="this:replace"
hx-trigger="htmx:afterOnLoad from:#plot-container target:#plot-options">
hx-trigger="load, htmx:afterOnLoad from:#plot-container target:#plot-options">
</div>
</div>
</div>
......
......@@ -21,8 +21,7 @@ from scipost.permissions import HTMXResponse
@login_required
@permission_required("scipost.can_explore_graphs", raise_exception=True)
def explorer(request):
form = PlotOptionsForm(request.POST or None)
form = PlotOptionsForm(request.POST or request.GET or None)
return render(
request,
"graphs/explorer.html",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment