Skip to content

Commit

Permalink
Add upgrade messaging to the homepage.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdreher committed Aug 29, 2014
1 parent d643d9d commit d694f2d
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 8 deletions.
19 changes: 18 additions & 1 deletion media/css/mediathread.css
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ div.button-form form, div.button-form.inline form {

.errornote {
background: url("/media/img/icon_alert.png") no-repeat 5px 5px #FFEBE8;
border: 1px solid #c00 !important;
border: 1px solid #ebccd1 !important;
display: block;
margin: 10px;
padding: 10px !important;
Expand All @@ -1245,6 +1245,23 @@ div.button-form form, div.button-form.inline form {
color: #c00;
}

.infonote {
width: 900px;
padding: 15px;
margin-bottom: 20px;
border: 1px solid transparent;
border-radius: 4px;
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;
}

.infonote a.dismiss {
margin-top: -10px;
float: right;
margin-right: -8px;
}

#introduction {
text-align: left;
background-color: #dedede;
Expand Down
2 changes: 1 addition & 1 deletion media/js/app/assetmgr/asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
this.dismissHelp = function () {
jQuery("#asset-view-overlay, #asset-view-help, #asset-view-help-tab").hide();
var checked = jQuery("#asset-view-show-help").is(":checked");
updateHelpSetting(MediaThread.current_username, 'help_item_detail_view', !checked);
updateUserSetting(MediaThread.current_username, 'help_item_detail_view', !checked);
return false;
};

Expand Down
6 changes: 3 additions & 3 deletions media/js/app/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function switcher(event, a) {
return false;
}

function updateHelpSetting(user, help_content_id, value) {
jQuery.post('/setting/' + user + '/', { name: help_content_id, value: value });
function updateUserSetting(user, setting, value) {
jQuery.post('/setting/' + user + '/', { name: setting, value: value });
}

function toggleHelp(a, user, parent, help_content_id, callback) {
Expand Down Expand Up @@ -83,7 +83,7 @@ function toggleHelpOverlay(btn, user, help_content_id) {
var elts = jQuery(checked_id);
if (elts.length) {
var checked = jQuery(elts[0]).is(":checked");
updateHelpSetting(MediaThread.current_username, help_content_id, !checked);
updateUserSetting(MediaThread.current_username, help_content_id, !checked);
}

return false;
Expand Down
2 changes: 2 additions & 0 deletions mediathread/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def triple_homepage(request):
'classwork_owner': classwork_owner,
'help_homepage_instructor_column': False,
'help_homepage_classwork_column': False,
'upgrade_bookmarklet': UserSetting.get_setting(
logged_in_user, "upgrade_bookmarklet", True),
'faculty_feed': Project.objects.faculty_compositions(request, course),
'is_faculty': course.is_faculty(logged_in_user),
'discussions': get_course_discussions(course),
Expand Down
2 changes: 1 addition & 1 deletion mediathread/templates/assetmgr/upgrade_bookmarklet.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block css %}
<style>
.upgrade-instructions {
width: 403px;
width: 370px;
margin-right: 55px;
}

Expand Down
11 changes: 10 additions & 1 deletion mediathread/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,16 @@

<li>
{% block standardnav_help %}
<div unselectable="on"><a href="/help/">Help</a></div>
<div class="settings_menu help closed">
<div class="right ui-icon-reverse ui-icon-triangle-1-s"></div>
<div class="left settings_menu_title">Help</div>
</div>
<div class="visualclear"></div>
<!-- Settings Menu -->
<div class="settings_submenu" style="display: none">
<a href="/help/">Knowledge Base</a>
<a href="/upgrade/">Upgrade Bookmarklet</a>
</div>
{% endblock %}
</li>

Expand Down
14 changes: 13 additions & 1 deletion mediathread/templates/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,23 @@
<div class="settings_submenu" style="display: none">
<a href="/help/">Knowledge Base</a>
<a href="#" onclick="jQuery(window).trigger('tour.start');">Homepage Tour</a>
<a href="/upgrade/">Upgrade Bookmarklet</a>
</div>
{% endblock %}

{% block content %}
{{ block.super }}

{% if upgrade_bookmarklet %}
<div class="infonote">
<a href="#" class="dismiss"
onclick="updateUserSetting('{{request.user.username}}', 'upgrade_bookmarklet', false); jQuery(this).parent().fadeOut(); return false;">
<img src="/media/img/switcher/icon_x.png"/>
</a>
The Mediathread bookmarklet has been updated to comply with new web security protocols. <a href="/upgrade/">Upgrade</a> your old bookmarklet now.
</div>
{% endif %}

<table id="home-columns">
<tbody>
<tr>
Expand Down Expand Up @@ -245,7 +257,7 @@ <h2 class="tour_3">Collection<div class="actions">{% include "help/help_button.h
<div class="tour_buttons">
<span class="button" id="prevstep" style=""> &lt; Prev</span>
<span class="button start" id="nextstep"
onclick="updateHelpSetting('{{request.user.username}}', 'help_show_homepage_tour', false);">
onclick="updateUserSetting('{{request.user.username}}', 'help_show_homepage_tour', false);">
Get Started &gt;
</span>
<span class="close ui-icon ui-icon-closethick" id="canceltour"></span>
Expand Down

0 comments on commit d694f2d

Please sign in to comment.