.
This commit is contained in:
@@ -7,6 +7,11 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<label for="exact">Exact match</label><input type="checkbox" name="exact">
|
<label for="exact">Exact match</label><input type="checkbox" name="exact">
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
<button
|
||||||
|
hx-post='{% url "oef:questions_diff" %}'
|
||||||
|
hx-target="#diff-results">Diff</button>
|
||||||
|
<span id="diff-results"></span>
|
||||||
<button hx-post="{% url 'oef:replace_questions' %}"
|
<button hx-post="{% url 'oef:replace_questions' %}"
|
||||||
hx-target='#result'>Replace</button>
|
hx-target='#result'>Replace</button>
|
||||||
<div id="result"></div>
|
<div id="result"></div>
|
||||||
|
|||||||
+6
-2
@@ -110,8 +110,12 @@ def entries_by_question(request):
|
|||||||
|
|
||||||
def questions_diff(request):
|
def questions_diff(request):
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
question1 = request.POST.get("question1")
|
question1 = request.POST.get("question1", False)
|
||||||
question2 = request.POST.get("question2")
|
question2 = request.POST.get("question2", False)
|
||||||
|
|
||||||
|
if not question1:
|
||||||
|
question1 = request.POST.get("search")
|
||||||
|
question2 = request.POST.get("replace")
|
||||||
|
|
||||||
html = HtmlDiff().make_table(question1.split("\n"), question2.split("\n"))
|
html = HtmlDiff().make_table(question1.split("\n"), question2.split("\n"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user