Skip to content

Commit

Permalink
Merge pull request #407 from ucsd-ets/release-candidate
Browse files Browse the repository at this point in the history
release-2020-07-29
  • Loading branch information
imhassantariq authored Jul 29, 2020
2 parents b952862 + 7b0c513 commit d230134
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 13 deletions.
60 changes: 60 additions & 0 deletions common/static/common/js/discussion/discussion.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,63 @@
}(Backbone.Collection));
}
}).call(window);


// Table Resizing
var orgTable;
var $clone;
var resizeTimer;
var resized = false;

$(window).load(function()
{
// Save default table layout
orgTable = $('#helperTable').html();
if (localStorage.getItem("discussionHelperTable") == null)
{
localStorage.setItem("discussionHelperTable", orgTable);
}
// Update table
renderTable();
});

// Update on window resize
$( window ).resize(function(e)
{
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {renderTable()},150);
});

// Update for smaller window size
function renderTable()
{
if ($(window).width() < 600 && !resized)
{
var replaceHTML = "";
resized = true;

$('.helpgrid-row').each(
function()
{
replaceHTML = "";
var headerHTML = $(this).find("th").html();


$(this).find("td").each(
function()
{
replaceHTML += '<div class="oneColumn">';
replaceHTML += $(this).html();
});
replaceHTML += '</div>';

$(this).html('<th scope="row" class="row-title">' + headerHTML + '</th> <td class="row-item">' + replaceHTML + '</td>');
});
}
else
{
orgTable = localStorage.getItem("discussionHelperTable");
$("#helperTable").html(orgTable);
resized = false;
}
}
1 change: 1 addition & 0 deletions lms/djangoapps/courseware/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2170,6 +2170,7 @@ def test_user_with_passing_grade(self, mock_is_course_passed):
'category': 'certificates',
'label': unicode(self.course.id)
},
send_to_track=True, user=self.student
)
mock_tracker.reset_mock()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{platform_name: window.PLATFORM_NAME}, true
) %>
</span>
<table class="home-helpgrid">
<table class="home-helpgrid" id="helperTable">
<tr class="helpgrid-row helpgrid-row-navigation">
<th scope="row" class="row-title"><%- gettext("Find discussions") %></td>
<td class="row-item">
Expand Down Expand Up @@ -46,15 +46,15 @@
</tr>
<tr class="helpgrid-row helpgrid-row-notification">
<th scope="row" class="row-title"><%- gettext('Receive updates') %></td>
<td class="row-item-full" colspan="3">
<td class="row-item-full" colspan="3" id="emailSettingsCol">
<label for="email-setting-checkbox">
<span class="sr"><%- gettext("Toggle Notifications Setting") %></span>
<span class="notification-checkbox">
<input type="checkbox" id="email-setting-checkbox" class="email-setting" name="email-notification"/>
<span class="icon fa fa-envelope" aria-hidden="true"></span>
</span>
</label>
<span class="row-description"><%- gettext("Check this box to receive an email digest once a day notifying you about new, unread activity from posts you are following.") %></span>
<div class="row-description" id="emailContent"><%- gettext("Check this box to receive an email digest once a day notifying you about new, unread activity from posts you are following.") %></div>
</td>
</tr>
</table>
Expand Down
1 change: 1 addition & 0 deletions lms/djangoapps/discussion/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,5 @@ def test_track_notification_sent(self, context, test_props):
user_id=context['thread_author_id'],
event_name='edx.bi.email.sent',
properties=test_props,
send_to_track=True
)
2 changes: 1 addition & 1 deletion lms/djangoapps/shoppingcart/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def _emit_order_event(self, event_name, orderitems):
'revenue': str(self.total_cost),
'currency': self.currency,
'products': [item.analytics_data() for item in orderitems]
}, send_to_track=True, user=user)
}, send_to_track=True, user=self.user)

except Exception: # pylint: disable=broad-except
# Capturing all exceptions thrown while tracking analytics events. We do not want
Expand Down
6 changes: 4 additions & 2 deletions lms/djangoapps/shoppingcart/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,10 @@ def test_purchase(self):
'price': '40.00',
'id': 1,
'quantity': 1
}
]
},
],
},
send_to_track=True, user=self.user
)

def test_purchase_item_failure(self):
Expand Down Expand Up @@ -889,6 +890,7 @@ def _assert_refund_tracked(self):
}
]
},
send_to_track=True, user=self.user
)

def test_existing_enrollment(self):
Expand Down
9 changes: 3 additions & 6 deletions lms/templates/user_dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@
</a>
<div class="dropdown">
<a class="dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">${username}</a>
<ul role="menu" class="dropdown-menu dropdown-menu-right" id="${_("Usermenu")}" aria-labelledby="dropdownMenuLink" tabindex="-1">
<li role="presentation"><a role="menuitem" class="dropdown-item" href="${reverse('dashboard')}">${_("Dashboard")}</a></li>
<ul role="menu" class="dropdown-menu dropdown-menu-right" id='${_("Usermenu")}' aria-labelledby="dropdownMenuLink" tabindex="-1">
<li role="presentation"><a role="menuitem" class="dropdown-item" href="${reverse('account_settings')}">${_("Account")}</a></li>
<li role="presentation"><a role="menuitem" class="dropdown-item" href="${reverse('logout')}">${_("Sign Out")}</a></li>
</ul>
</div>
</div>
</div>
<ul role="menu" class="nav flex-column align-items-center">
<li role="presentation" class="nav-item nav-item-open-collapsed-only collapse"><a role="menuitem" href="${reverse('dashboard')}">${_("Dashboard")}</a></li>
<li role="presentation" class="nav-item nav-item-open-collapsed-only"><a role="menuitem" href="${reverse('account_settings')}">${_("Account")}</a></li>
<li role="presentation" class="nav-item nav-item-open-collapsed-only"><a role="menuitem" href="${reverse('logout')}">${_("Sign Out")}</a></li>
</ul>
Expand All @@ -47,13 +45,12 @@
${username}
</a>
<div role="group" aria-label="User menu" class="user-menu">
<button type="button" class="menu-button button-more has-dropdown js-dropdown-button" aria-expanded="false" aria-controls="${_("Usermenu")}">
<button type="button" class="menu-button button-more has-dropdown js-dropdown-button" aria-expanded="false" aria-controls='${_("Usermenu")}'>
<span class="icon fa fa-caret-down" aria-hidden="true"></span>
<span class="sr-only">${_("Usermenu dropdown")}</span>
</button>
<ul class="dropdown-menu list-divided is-hidden" id="${_("Usermenu")}" tabindex="-1">
<ul class="dropdown-menu list-divided is-hidden" id='${_("Usermenu")}' tabindex="-1">
<%block name="navigation_dropdown_menu_links" >
<li class="dropdown-item item has-block-link"><a href="${reverse('dashboard')}" role="menuitem" class="action dropdown-menuitem">${_("Dashboard")}</a></li>
<li class="dropdown-item item has-block-link"><a href="${reverse('account_settings')}" role="menuitem" class="action dropdown-menuitem">${_("Account")}</a></li>
</%block>
<li class="dropdown-item item has-block-link"><a href="${reverse('logout')}" role="menuitem" class="action dropdown-menuitem">${_("Sign Out")}</a></li>
Expand Down
2 changes: 1 addition & 1 deletion requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ numpy==1.6.2
oauth2==1.9.0.post1
oauthlib==2.1.0
openapi-codec==1.3.2 # via django-rest-swagger
openedx-caliper-tracking==0.13.0
openedx-caliper-tracking==0.14.1
path.py==8.2.1
pathtools==0.1.2
paver==1.3.4
Expand Down

0 comments on commit d230134

Please sign in to comment.