Skip to content

Commit 80f876a

Browse files
author
robert-knight
committed
Made embedded signing ceremony the only item on the homepage when quickstart is true
1 parent 1d9d331 commit 80f876a

3 files changed

Lines changed: 63 additions & 7 deletions

File tree

app/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
csrf = CSRFProtect(app)
1717

1818
# Set whether this is a quickstart in config
19-
app.config["quickstart"] = DS_CONFIG["quickstart"]
19+
#app.config["quickstart"] = DS_CONFIG["quickstart"]
2020

2121
# Set whether user has logged in
22-
app.config["isLoggedIn"] = False
22+
#app.config["isLoggedIn"] = False
2323

2424
# Register home page
2525
app.register_blueprint(core)
26+
2627
# Register OAuth
2728
app.register_blueprint(ds)
2829
# Register examples

app/templates/quickstarthome.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!-- extend base layout -->
2+
{% extends "base.html" %}
3+
4+
{% block content %}
5+
6+
{% if not 'ds_user_name' in session %}
7+
<!-- IF not signed in -->
8+
<div>
9+
<div class="jumbotron jumbotron-fluid"> <table>
10+
<tbody>
11+
<tr>
12+
<td>
13+
<h1 class="display-4">Python Launcher</h1>
14+
<p class="Xlead">Welcome to the DocuSign Python examples using multiple OAuth flows (JWT and Authorization Code Grant).</p>
15+
</td>
16+
<td>
17+
<img src="/static/assets/banner-code.png" />
18+
</td>
19+
</tr>
20+
</tbody>
21+
</table>
22+
</div>
23+
{% endif %}
24+
25+
<!-- Future: add a table of contents or navigation pane
26+
Eg, see https://stackoverflow.com/questions/21868610/make-column-fixed-position-in-bootstrap
27+
-->
28+
29+
<div class="container" style="margin-top: 40px" id="index-page">
30+
<h2>Welcome</h2>
31+
<p>This launcher includes the following examples for the DocuSign eSignature REST API.</p>
32+
33+
{% if show_doc %}
34+
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> on using JWT or Authorization Code Grant from a Python Flask application.</p>
35+
{% endif %}
36+
37+
<h2>Basic Examples</h2>
38+
39+
<h4 id="example001">1. <a href="eg001">Embedded Signing Ceremony</a></h4>
40+
<p>This example sends an envelope, and then uses an embedded signing ceremony for the first signer.
41+
With embedded signing, the DocuSign signing ceremony is initiated from your website.
42+
</p>
43+
<p>API methods used:
44+
<a target ='_blank' href="https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create">Envelopes::create</a> and
45+
<a target ='_blank' href="https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient">EnvelopeViews::createRecipient</a>.
46+
</p>
47+
</div>
48+
49+
<!-- anchor-js is only for the index page -->
50+
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.1/anchor.min.js"></script>
51+
<script>anchors.options.placement = 'left'; anchors.add('h4')</script>
52+
53+
{% endblock %}

app/views.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88

99
@core.route("/")
1010
def index():
11-
#if quickstart go to eg001 else go to homepage
12-
quickstart=app.config["quickstart"]
13-
if quickstart == True:
14-
return render_template("eg001_embedded_signing.html", title="Embedded signing ceremony")
11+
qs = DS_CONFIG["quickstart"]
12+
if qs:
13+
return redirect(url_for("core.qshome"))
1514
else:
1615
return render_template("home.html", title="Home - Python Code Examples")
1716

17+
@core.route("/quickstarthome")
18+
def qshome():
19+
return render_template("quickstarthome.html", title = "Homepage for Quickstart")
20+
1821
@core.route("/index")
1922
def r_index():
2023
return redirect(url_for("core.index"))
2124

22-
2325
@core.app_errorhandler(404)
2426
def not_found_error(error):
2527
return render_template("404.html"), 404

0 commit comments

Comments
 (0)