11{% if message %}
2- < div class ="message {% if type == 'error' %}error{% else %}success{% endif %} ">
3- {{ message }}
4- </ div >
2+ < div class ="message {% if type == 'error' %}error{% else %}success{% endif %} ">
3+ {{ message }}
4+ </ div >
55{% endif %}
66
77{% if sql_query %}
8- < div class ="query-section ">
9- < h3 > Generated SQL Query</ h3 >
10- < div class ="query-box "> {{ sql_query }}</ div >
11-
12- {% if query_token %}
13- < div class ="actions-container ">
14- < div class ="action-group ">
15- < form class ="action-form ">
16- < input type ="hidden " name ="query_token " value ="{{ query_token }} ">
17- < button
18- hx-post ="/execute-sql "
19- hx-trigger ="click "
20- hx-target ="#query-result "
21- hx-include ="[name='query_token'] "
22- type ="button "
23- class ="primary-button "
24- >
25- < span > Execute Query</ span >
26- < span class ="spinner htmx-indicator "> </ span >
27- </ button >
28- </ form >
29- </ div >
8+ < div class ="query-section ">
9+ < h3 > Generated SQL Query</ h3 >
10+ < div class ="query-box "> {{ sql_query }}</ div >
3011
31- < div class ="feedback-group " id ="feedback-group ">
32- < span class ="feedback-label "> Was this query correct?</ span >
33- < div class ="feedback-buttons ">
34- < button
35- hx-post ="/submit-feedback "
36- hx-target ="#feedback-result "
37- hx-include ="[name='query_token'] "
38- hx-vals ='{"feedback": "yes"} '
39- class ="feedback-button yes "
40- >
41- < svg width ="16 " height ="16 " viewBox ="0 0 24 24 " fill ="none " stroke ="currentColor " stroke-width ="2 ">
42- < polyline points ="20 6 9 17 4 12 "> </ polyline >
43- </ svg >
44- Yes
45- </ button >
46- < button
47- hx-post ="/submit-feedback "
48- hx-target ="#feedback-result "
49- hx-include ="[name='query_token'] "
50- hx-vals ='{"feedback": "no"} '
51- class ="feedback-button no "
52- >
53- < svg width ="16 " height ="16 " viewBox ="0 0 24 24 " fill ="none " stroke ="currentColor " stroke-width ="2 ">
54- < line x1 ="18 " y1 ="6 " x2 ="6 " y2 ="18 "> </ line >
55- < line x1 ="6 " y1 ="6 " x2 ="18 " y2 ="18 "> </ line >
56- </ svg >
57- No
58- </ button >
59- </ div >
60- </ div >
61- </ div >
12+ {% if query_token %}
13+ < div class ="actions-container ">
14+ < div class ="action-group ">
15+ < form class ="action-form ">
16+ < input type ="hidden " name ="query_token " value ="{{ query_token }} ">
17+ < button hx-post ="/execute-sql " hx-trigger ="click " hx-target ="#query-result "
18+ hx-include ="[name='query_token'] " type ="button " class ="primary-button ">
19+ < span > Execute Query</ span >
20+ < span class ="spinner htmx-indicator "> </ span >
21+ </ button >
22+ </ form >
23+ </ div >
6224
63- < div id ="feedback-result "> </ div >
64- {% endif %}
25+ < div class ="feedback-group " id ="feedback-group ">
26+ < span class ="feedback-label "> Was this query correct?</ span >
27+ < div class ="feedback-buttons ">
28+ < button hx-post ="/submit-feedback " hx-target ="#feedback-result " hx-include ="[name='query_token'] "
29+ hx-vals ='{"feedback": "yes"} ' class ="feedback-button yes ">
30+ < svg width ="16 " height ="16 " viewBox ="0 0 24 24 " fill ="none " stroke ="currentColor " stroke-width ="2 ">
31+ < polyline points ="20 6 9 17 4 12 "> </ polyline >
32+ </ svg >
33+ Yes
34+ </ button >
35+ < button hx-post ="/submit-feedback " hx-target ="#feedback-result " hx-include ="[name='query_token'] "
36+ hx-vals ='{"feedback": "no"} ' class ="feedback-button no ">
37+ < svg width ="16 " height ="16 " viewBox ="0 0 24 24 " fill ="none " stroke ="currentColor " stroke-width ="2 ">
38+ < line x1 ="18 " y1 ="6 " x2 ="6 " y2 ="18 "> </ line >
39+ < line x1 ="6 " y1 ="6 " x2 ="18 " y2 ="18 "> </ line >
40+ </ svg >
41+ No
42+ </ button >
43+ </ div >
44+ </ div >
6545 </ div >
46+
47+ < div id ="feedback-result "> </ div >
48+ {% endif %}
49+ </ div >
6650{% endif %}
6751
6852{% if column_names and results %}
69- < div class ="results-section ">
70- < h3 > Query Results</ h3 >
71- < div class ="table-container ">
72- < table class ="results-table ">
73- < thead >
74- < tr >
75- {% for column in column_names %}
76- < th data-column ="{{ column }} "> {{ column }}</ th >
77- {% endfor %}
78- </ tr >
79- </ thead >
80- < tbody >
81- {% for row in results %}
82- < tr >
83- {% for value in row %}
84- < td title ="{{ value }} "> {{ value }}</ td >
85- {% endfor %}
86- </ tr >
53+ < div class ="results-section ">
54+ < h3 > Query Results</ h3 >
55+ < div class ="table-container ">
56+ < table class ="results-table ">
57+ < thead >
58+ < tr >
59+ {% for column in column_names %}
60+ < th data-column ="{{ column }} "> {{ column }}</ th >
8761 {% endfor %}
88- </ tbody >
89- </ table >
90- </ div >
62+ </ tr >
63+ </ thead >
64+ < tbody >
65+ {% for row in results %}
66+ < tr >
67+ {% for value in row %}
68+ < td title ="{{ value }} "> {{ value }}</ td >
69+ {% endfor %}
70+ </ tr >
71+ {% endfor %}
72+ </ tbody >
73+ </ table >
9174 </ div >
75+ </ div >
9276{% endif %}
9377
78+ {% if similar_rows %}
79+ < div class ="results-section ">
80+ < h3 > Similar Rows</ h3 >
81+ < pre > {{ similar_rows }}</ pre >
82+ < div class ="pagination ">
83+ {% if page > 1 %}
84+ < a href ="?page={{ page - 1 }}&page_size={{ page_size }} " class ="pagination-button "> Previous</ a >
85+ {% endif %}
86+ < span > Page {{ page }}</ span >
87+ < a href ="?page={{ page + 1 }}&page_size={{ page_size }} " class ="pagination-button "> Next</ a >
88+ </ div >
89+ </ div >
90+ {% endif %}
0 commit comments