ソースを参照

fix: restore the missing quote-comment dialog on the task page (highlight-to-comment popover opened nothing)

clanker 1 ヶ月 前
親
コミット
dad7e9a882
2 ファイル変更、26 行追加、0 行削除
  1. 16 0
      src/pages/task_detail.html
  2. 10 0
      test/web_stack_test.py

+ 16 - 0
src/pages/task_detail.html

@@ -402,6 +402,22 @@
                 <button type="submit" class="primary">Comment</button>
             </form>
 
+            <!-- The highlight-to-comment popover (main.html) fills and opens
+                 this dialog; it went missing in a template rework, which broke
+                 quoting on RFC bodies. -->
+            <dialog id="quote-comment-dialog">
+                <h3>Comment on selected text</h3>
+                <blockquote id="quote-text" class="term-comment-quote"></blockquote>
+                <form stm-action="task.comment">
+                    <input type="hidden" name="task_id" stm-attribute.value="task.id">
+                    <input type="hidden" name="quote">
+                    <input type="hidden" name="return_to">
+                    <textarea name="body" rows="4" placeholder="Your comment…" style="width:100%; margin:0.5em 0;"></textarea>
+                    <button type="submit" class="primary">Send comment</button>
+                    <button type="button" onclick="document.getElementById('quote-comment-dialog').close()">Cancel</button>
+                </form>
+            </dialog>
+
             <h3>Subtasks</h3>
             <table>
                 <thead><tr><th>#</th><th>Title</th><th>Status</th></tr></thead>

+ 10 - 0
test/web_stack_test.py

@@ -429,6 +429,16 @@ def main():
         check(rfc.get("show_body") is True,
               "answered plan review shows the body again (review section gone)")
 
+        print("== B1: highlight-to-comment quote dialog ==")
+        status, page = http("GET", "/tasks/%d" % plan_task, timeout=15)
+        check(status == 200 and "quote-comment-dialog" in page and "quote-text" in page,
+              "task page carries the quote-comment dialog the popover opens")
+        check('name="quote"' in page and 'name="return_to"' in page,
+              "quote dialog posts the quote and return-to fields")
+        status, page = http("GET", "/tasks/%d/terminal" % plan_task, timeout=15)
+        check(status == 200 and "quote-comment-dialog" in page,
+              "terminal page keeps its quote dialog")
+
         print("== feature 5: rules ==")
         rules_state = slot_public(auth, "/rules", "rules")
         for name, body in [