Skip to content

Commit

Permalink
Release candidate (#144)
Browse files Browse the repository at this point in the history
* Change text on logout page

* Change logout url

* Timed Exams - Sticky header for timer (#140)

* Timed Exams - Sticky header for timer feedback (#141)

* Timed Exams - Sticky header for timer (#142)

* Fix Logout Issue in Colaraz Themem

Co-authored-by: M Umar Khan <[email protected]>
Co-authored-by: Muhammad Umar Khan <[email protected]>
Co-authored-by: Rahat Ali <[email protected]>
  • Loading branch information
4 people authored Feb 3, 2022
1 parent 292a87d commit 4e97e8c
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 22 deletions.
14 changes: 13 additions & 1 deletion colaraz/cms/static/js/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,18 @@ function receiveMessage(e) {
return;
const status = e.data;
if (status.isUserLoggedIn === false || status.userName !== currentUserEmail) {
window.location.replace(edXLogoutUrl)
$.ajax({
type: 'POST',
url: edXLogoutUrl,
data: {
email: currentUserEmail,
},
success: function (response) {
location.reload();
},
error: function (response) {
console.log("Error occured while calling session api!!");
},
});
}
}
4 changes: 2 additions & 2 deletions colaraz/cms/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@
var colarazCheckSessionUrl = "${getattr(settings, 'COLARAZ_CHECK_SESSION', {}).get('CHECK_SESSION_URL')}";
var colarazCheckSessionRefreshTime = ${getattr(settings, 'COLARAZ_CHECK_SESSION', {}).get('REFRESH_TIME_MILLISECONDS', 60000)};
var colarazCheckSessionKey = "${getattr(settings, 'COLARAZ_CHECK_SESSION', {}).get('COLARAZ_CHECK_SESSION_KEY')}";
var edXLogoutUrl = "${reverse('logout')}";
var edXLogoutUrl = "${reverse('colaraz_features:session_logout')}";
% if user.is_authenticated:
% if user.id != request.session['_auth_user_id']:
var currentUserEmail = "${User.objects.get(id=request.session['_auth_user_id']).email}";
% else:
var currentUserEmail = "${user.email}";
% endif
% endif
% endif

</script>
Expand Down
14 changes: 13 additions & 1 deletion colaraz/lms/static/js/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,18 @@ function receiveMessage(e) {
return;
const status = e.data;
if (status.isUserLoggedIn === false || status.userName !== currentUserEmail) {
window.location.replace(edXLogoutUrl)
$.ajax({
type: 'POST',
url: edXLogoutUrl,
data: {
email: currentUserEmail,
},
success: function (response) {
location.reload();
},
error: function (response) {
console.log("Error occured while calling session api!!");
},
});
}
}
96 changes: 82 additions & 14 deletions colaraz/lms/static/sass/course/layout/_courseware_preview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

.content-wrapper {

&:before {
content: '';
display: table;
}

.course-tabs {
margin-top: 0;
background: $gray-mid-border;
Expand All @@ -25,6 +30,83 @@
}
}

body {

.proctored_exam_status {
margin: $baseline*.5;
width: auto;

@include media-up(md) {
top: 100px;
position: sticky;
z-index: 12;
}

.exam-timer {
color: $black;
padding: $baseline*.75 $baseline*.5;

&:after {
content: '';
display: block;
clear: both;
}

.exam-timer-clock {
background: #fff;
border-radius: 20px;

span {
display: inline-block;
min-width: 50px;
}
}

.exam-timer-clock {

#toggle_timer {
background: $primary;
border-radius: 0 20px 20px 0;
color: $text-color;

&:hover {
background: $primary-dark;
}
}
}

.exam-button-turn-in-exam {
background: $primary;
border-radius: 20px;
color: $text-color;

&:hover {
background: $primary-dark;
}
}

.exam-text {

@include media-down(md) {
display: block;
padding-bottom: $baseline;
width: auto;
}
}
}

&.is-fixed {
position: static;
width: auto;

@include media-up(md) {
position: sticky;
top: 100px;
}
}
}
}

.view-in-course {

table {
Expand All @@ -47,20 +129,6 @@
}
}

.proctored_exam_status {
margin: $baseline*.5;
width: auto;

.exam-timer {
color: $black;
}

&.is-fixed {
position: static;
width: auto;
}
}

.container {
max-width: $container-default;
}
Expand Down
3 changes: 1 addition & 2 deletions colaraz/lms/templates/logout.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@

{% block body %}
<h1>{% trans "You have signed out." %}</h1>
<h1>amjad amjad amjad</h1>

<p style="text-align: center; margin-bottom: 20px;">
{% blocktrans trimmed %}
If you are not redirected within 5 seconds, <a href="{{ target }}">click here to go to the home page</a>.
If you are not redirected within 5 seconds, <a href="{{ target }}">click here to go to the login page</a>.
{% endblocktrans %}
</p>

Expand Down
4 changes: 2 additions & 2 deletions colaraz/lms/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,13 @@ <h2 class="account-status-title sr">${_("Account Status Info")}: </h2>
var colarazCheckSessionUrl = "${getattr(settings, 'COLARAZ_CHECK_SESSION', {}).get('CHECK_SESSION_URL')}";
var colarazCheckSessionRefreshTime = ${getattr(settings, 'COLARAZ_CHECK_SESSION', {}).get('REFRESH_TIME_MILLISECONDS', 60000)};
var colarazCheckSessionKey = "${getattr(settings, 'COLARAZ_CHECK_SESSION', {}).get('COLARAZ_CHECK_SESSION_KEY')}";
var edXLogoutUrl = "${reverse('logout')}";
var edXLogoutUrl = "${reverse('colaraz_features:session_logout')}";
% if user.is_authenticated:
% if user.id != request.session['_auth_user_id']:
var currentUserEmail = "${User.objects.get(id=request.session['_auth_user_id']).email}";
% else:
var currentUserEmail = "${user.email}";
% endif
% endif
% endif

// Colaraz Discussion Forum API variables
Expand Down

0 comments on commit 4e97e8c

Please sign in to comment.