Skip to content

Commit e2c5379

Browse files
authored
Merge pull request #11 from ThinkR-open/patch-2
chore: add info to template
2 parents c7386ec + 587e649 commit e2c5379

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

.github/workflows/run-pytest.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
run: poetry install --no-interaction
2525

2626
- name: 🕸️ Ensure browsers are installed
27-
run: poetry run playwright install
27+
run: poetry run playwright install --with-deps
2828

2929
- name: 🧪 Run tests
30-
run: poetry run pytest --github-report -vvv
30+
run: poetry run pytest --github-report -vvv --browser webkit --browser chromium --browser firefox

signature/app.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@
4444

4545
def server(input: Inputs, output: Outputs, session: Session):
4646
reactive_values = reactive.Value(
47-
{"firstname", "lastname", "jobtitle", "email", "phone"}
47+
{
48+
"firstname",
49+
"lastname",
50+
"jobtitle",
51+
"email",
52+
"email_url",
53+
"phone",
54+
"phone_url",
55+
}
4856
)
4957

5058
mod_form.form_server("form_signature", reactive_values=reactive_values)

signature/modules/mod_form.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def _():
8989
"lastname": input.lastname(),
9090
"job_title": input.job_title(),
9191
"email": input.email(),
92+
"email_url": f"mailto:{input.email()}",
9293
"phone": input.phone(),
94+
"phone_url": f"tel:{input.phone()}",
9395
}
9496
)

signature/modules/mod_preview.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,18 @@ def render_template() -> str:
7272
last_name = reactive_values().get("lastname")
7373
job_title = reactive_values().get("job_title")
7474
email = reactive_values().get("email")
75+
email_url = reactive_values().get("email_url")
7576
phone = reactive_values().get("phone")
77+
phone_url = reactive_values().get("phone_url")
7678

7779
rendered_template = template.render(
7880
firstname="{{firstname}}" if first_name == "" else first_name,
7981
lastname="{{lastname}}" if last_name == "" else last_name,
8082
job_title="{{job_title}}" if job_title == "" else job_title,
8183
email="{{email}}" if email == "" else email,
8284
phone="{{phone}}" if phone == "" else phone,
85+
email_url="{{email_url}}" if email_url == "" else email_url,
86+
phone_url="{{phone_url}}" if phone_url == "" else phone_url,
8387
)
8488
return rendered_template
8589

0 commit comments

Comments
 (0)