Skip to content

Commit 9fb08cf

Browse files
Added source code links to all rooms API examples
1 parent 5970e1b commit 9fb08cf

18 files changed

Lines changed: 50 additions & 9 deletions

File tree

app/rooms/examples/eg001_create_room_with_data/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@ def get_view():
5353
return render_template(
5454
"eg001_create_room_with_data.html",
5555
title="Creating a room with data",
56-
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
56+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
57+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
5758
)

app/rooms/examples/eg002_create_room_with_template/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def get_view():
6666
return render_template(
6767
"eg002_create_room_with_template.html",
6868
title="Creating a room with a template",
69-
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
69+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
70+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
7071
templates=templates
7172
)

app/rooms/examples/eg003_export_data_from_room/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def get_view():
6262
return render_template(
6363
"eg003_export_data_from_room.html",
6464
title="Exporting data from a room",
65-
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
65+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
66+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
6667
rooms=rooms,
6768
)

app/rooms/examples/eg004_add_forms_to_room/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def get_view():
6565
return render_template(
6666
"eg004_add_forms_to_room.html",
6767
title="Adding forms to a room",
68-
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
68+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
69+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
6970
rooms=rooms,
7071
forms=forms
7172
)

app/rooms/examples/eg005_get_rooms_with_filters/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def get_view():
6969
return render_template(
7070
"eg005_get_rooms_with_filters.html",
7171
title="Getting rooms with filters",
72-
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
72+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
73+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
7374
rooms=rooms,
7475
start=start_date.strftime("%Y-%m-%d"),
7576
end=end_date.strftime("%Y-%m-%d")

app/rooms/examples/eg006_create_external_form_fill_session/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def get_view():
6464
return render_template(
6565
"eg006_create_external_form_fill_session.html",
6666
title="Create an external form fill session",
67-
source_file=path.basename(path.dirname(__file__)) + "/controller.py",
67+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
68+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
6869
rooms=rooms,
6970
)
7071

app/rooms/examples/eg007_create_form_group/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@ def get_view():
5353
return render_template(
5454
"eg007_create_form_group.html",
5555
title="Creating a form group",
56-
source_file=path.basename(path.dirname(__file__)) + "/controller.py"
56+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
57+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
5758
)

app/rooms/examples/eg008_grant_office_access_to_form_group/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from docusign_rooms.client.api_exception import ApiException
22
from flask import Blueprint, render_template, current_app
33

4+
from os import path
5+
46
from app.docusign import authenticate
57
from app.error_handlers import process_error
68
from .controller import Eg008Controller
@@ -63,5 +65,7 @@ def get_view():
6365
return render_template(
6466
"eg008_grant_office_access_to_form_group.html",
6567
offices=offices,
66-
form_groups=form_groups
68+
form_groups=form_groups,
69+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
70+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
6771
)

app/rooms/examples/eg009_assign_form_to_form_group/views.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
from os import path
23

34
from docusign_rooms.client.api_exception import ApiException
45
from flask import Blueprint, render_template, current_app
@@ -73,5 +74,7 @@ def get_view():
7374
return render_template(
7475
"eg009_assign_form_to_form_group.html",
7576
forms=forms,
76-
form_groups=form_groups
77+
form_groups=form_groups,
78+
source_file=path.relpath(path.dirname(__file__), start='app') + "/controller.py",
79+
source_url="https://github.com/docusign/code-examples-python/tree/master/app/" + path.relpath(path.dirname(__file__), start='app') + "/controller.py",
7780
)

app/rooms/templates/eg001_create_room_with_data.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ <h4>1. Creating a room with data</h4>
1212
<a target ='_blank' href="https://developers.docusign.com/rooms-api/reference/Rooms/Rooms/CreateRoom">Rooms::CreateRoom</a> and
1313
<a target ='_blank' href="https://developers.docusign.com/rooms-api/reference/Roles/Roles/GetRoles">Roles::GetRoles</a>
1414
</p>
15+
<p>
16+
View source file <a target="_blank" href="{{ source_url | safe }}">{{ source_file }}</a> on GitHub.
17+
</p>
1518

1619
<form class="eg" action="" method="post" data-busy="form">
1720
<div class="form-group">

0 commit comments

Comments
 (0)