Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 00314e2

Browse files
author
Brad Miller
committed
Populate login from template
1 parent 2879ade commit 00314e2

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

runestone/common/js/bookfuncs.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,8 @@ function gotUser(data, status, whatever) {
147147
} else {
148148
if (!caughtErr) {
149149
mess = "username: " + d.nick;
150-
eBookConfig.email = d.email;
151-
eBookConfig.isLoggedIn = true;
152-
eBookConfig.isInstructor = d.isInstructor;
153150
// If the user is not an instructor then remove the link to the instructors page
154-
if (! d.isInstructor) {
151+
if (! eBookConfig.isInstructor) {
155152
$("#ip_dropdown_link").remove()
156153
}
157154
$(document).trigger("runestone:login")

runestone/common/project_template/_templates/plugin_layouts/sphinx_bootstrap/layout.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@
237237
eBookConfig.app = eBookConfig.host + '/' + '{{= request.application }}';
238238
eBookConfig.course = '{{= course_name }}';
239239
eBookConfig.basecourse = '{{= base_course }}';
240+
eBookConfig.isLoggedIn = {{= is_logged_in}};
241+
eBookConfig.email = '{{= user_email }}';
240242
eBookConfig.isInstructor = {{= is_instructor }}
241243
{% endraw %}
242244
{% else %}
@@ -250,7 +252,6 @@
250252
eBookConfig.logLevel = {{loglevel}};
251253
eBookConfig.loginRequired = {{login_required}};
252254
eBookConfig.build_info = "{{build_info}}";
253-
eBookConfig.isLoggedIn = false;
254255
eBookConfig.python3 = {{ python3 }};
255256
eBookConfig.acDefaultLanguage = '{{ default_ac_lang }}' ? '{{ default_ac_lang }}' : 'python'
256257
eBookConfig.runestone_version = '{{ runestone_version }}';

0 commit comments

Comments
 (0)