Always send numeric queue position in upload notification email
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
<h1 style="color:{accent_color};">Upload Successful</h1>
|
<h1 style="color:{accent_color};">Upload Successful</h1>
|
||||||
<p>Dear user,</p>
|
<p>Dear user,</p>
|
||||||
<p>Your file has been successfully uploaded and is now in our processing queue. This means that our system has received your file, and it is waiting to be processed. We will handle your file as soon as possible.</p>
|
<p>Your file has been successfully uploaded and is now in our processing queue. This means that our system has received your file, and it is waiting to be processed. We will handle your file as soon as possible.</p>
|
||||||
<p class="success-message">Your current position in the queue is: {queue_position}. This is the order in which your file will be processed. We appreciate your patience as we work through the queue.</p>
|
<p class="success-message">Your current position in the queue is: <span style="color:{accent_color}; font-weight:bold;">{queue_position}</span>. This is the order in which your file will be processed. We appreciate your patience as we work through the queue.</p>
|
||||||
<p>We will notify you once your file has been processed. If you have any urgent needs or further questions, feel free to reach out to our support team.</p>
|
<p>We will notify you once your file has been processed. If you have any urgent needs or further questions, feel free to reach out to our support team.</p>
|
||||||
<div class="contact">
|
<div class="contact">
|
||||||
<p>You can contact our support team at <a href="mailto:{contact_email}" style="color:{accent_color};">{contact_email}</a>. Please note that our support team is here to help with any questions or issues you might have.</p>
|
<p>You can contact our support team at <a href="mailto:{contact_email}" style="color:{accent_color};">{contact_email}</a>. Please note that our support team is here to help with any questions or issues you might have.</p>
|
||||||
|
|||||||
+15
-14
@@ -291,26 +291,25 @@ def create_transcript_docx(text: str, filename: str):
|
|||||||
- 12pt Courier
|
- 12pt Courier
|
||||||
- Continuous line numbering on the left
|
- Continuous line numbering on the left
|
||||||
- Speaker names capitalized and indented; spoken text further indented
|
- Speaker names capitalized and indented; spoken text further indented
|
||||||
|
- No section headings; use bold/underline only.
|
||||||
"""
|
"""
|
||||||
doc = Document()
|
doc = Document()
|
||||||
section = doc.sections[0]
|
|
||||||
|
|
||||||
# Margins
|
# Set margins via section properties
|
||||||
|
section = doc.sections[0]
|
||||||
section.left_margin = Inches(1.5)
|
section.left_margin = Inches(1.5)
|
||||||
section.right_margin = Inches(1.0)
|
section.right_margin = Inches(1.0)
|
||||||
section.top_margin = Inches(1.0)
|
section.top_margin = Inches(1.0)
|
||||||
section.bottom_margin = Inches(1.0)
|
section.bottom_margin = Inches(1.0)
|
||||||
|
|
||||||
# Line numbering (continuous, left side)
|
# Enable continuous line numbering on the left
|
||||||
section_type = section.element.find(qn("w:sectionPr"))
|
sectPr = section._element
|
||||||
if section_type is None:
|
lnNumType = sectPr.find(qn("w:lnNumType"))
|
||||||
section_type = OxmlElement("w:sectionPr")
|
if lnNumType is None:
|
||||||
section.element.insert(0, section_type)
|
lnNumType = OxmlElement("w:lnNumType")
|
||||||
|
sectPr.append(lnNumType)
|
||||||
line_num = OxmlElement("w:lineNumbering")
|
lnNumType.set(qn("w:start"), "continuous")
|
||||||
line_num.set(qn("w:start"), "continuous")
|
lnNumType.set(qn("w:countBy"), "1")
|
||||||
line_num.set(qn("w:countBy"), "1")
|
|
||||||
section_type.append(line_num)
|
|
||||||
|
|
||||||
# Default font
|
# Default font
|
||||||
style = doc.styles["Normal"]
|
style = doc.styles["Normal"]
|
||||||
@@ -329,15 +328,16 @@ def create_transcript_docx(text: str, filename: str):
|
|||||||
m = re.match(r"\[(\d+:\d+(?::\d+)?)\]\s*(.+?):\s*(.*)", line)
|
m = re.match(r"\[(\d+:\d+(?::\d+)?)\]\s*(.+?):\s*(.*)", line)
|
||||||
if m:
|
if m:
|
||||||
ts, speaker, content = m.groups()
|
ts, speaker, content = m.groups()
|
||||||
# Speaker line
|
# Speaker line: bold, underlined, indented
|
||||||
p_spk = doc.add_paragraph()
|
p_spk = doc.add_paragraph()
|
||||||
p_spk.paragraph_format.left_indent = Inches(0.25)
|
p_spk.paragraph_format.left_indent = Inches(0.25)
|
||||||
run_spk = p_spk.add_run(f"[{ts}] {speaker.upper()}")
|
run_spk = p_spk.add_run(f"[{ts}] {speaker.upper()}")
|
||||||
run_spk.bold = True
|
run_spk.bold = True
|
||||||
|
run_spk.underline = True
|
||||||
run_spk.font.name = "Courier"
|
run_spk.font.name = "Courier"
|
||||||
run_spk.font.size = Pt(12)
|
run_spk.font.size = Pt(12)
|
||||||
|
|
||||||
# Spoken text line
|
# Spoken text line: further indented
|
||||||
p_txt = doc.add_paragraph()
|
p_txt = doc.add_paragraph()
|
||||||
p_txt.paragraph_format.left_indent = Inches(0.5)
|
p_txt.paragraph_format.left_indent = Inches(0.5)
|
||||||
run_txt = p_txt.add_run(content.strip())
|
run_txt = p_txt.add_run(content.strip())
|
||||||
@@ -356,6 +356,7 @@ def create_transcript_docx(text: str, filename: str):
|
|||||||
def create_summary_docx(text: str, filename: str):
|
def create_summary_docx(text: str, filename: str):
|
||||||
"""
|
"""
|
||||||
Create a .docx summary with consistent font.
|
Create a .docx summary with consistent font.
|
||||||
|
No section headings; use bold/underline only.
|
||||||
"""
|
"""
|
||||||
doc = Document()
|
doc = Document()
|
||||||
style = doc.styles["Normal"]
|
style = doc.styles["Normal"]
|
||||||
|
|||||||
+1
-1
@@ -118,7 +118,7 @@ def send_initial_email(to: str, queue_pos: int):
|
|||||||
try:
|
try:
|
||||||
html = load_template(
|
html = load_template(
|
||||||
"upload_notification_template.html",
|
"upload_notification_template.html",
|
||||||
queue_position=str(queue_pos) if queue_pos > 0 else "the queue",
|
queue_position=str(max(queue_pos, 1)),
|
||||||
)
|
)
|
||||||
except EmailError as e:
|
except EmailError as e:
|
||||||
logger.warning("Failed to render upload notification template: %s", e)
|
logger.warning("Failed to render upload notification template: %s", e)
|
||||||
|
|||||||
Reference in New Issue
Block a user