no restart box (bug 584609)
This commit is contained in:
Родитель
4935ebb994
Коммит
960916192a
|
@ -41,6 +41,13 @@
|
|||
<div id="addon-summary-wrapper">
|
||||
<div id="addon-summary" class="primary">
|
||||
<p{{ addon.summary|locale_html }}>{{ addon.summary|nl2br }}</p>
|
||||
{% with files = addon.current_version.all_files %}
|
||||
{% if files and files[0].no_restart %}
|
||||
<div id="no-restart" class="js-hidden">
|
||||
<span id="no-restart-msg">{{ _('No restart required') }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
{{ big_install_button(addon, show_warning=False) }}
|
||||
|
||||
|
|
|
@ -707,6 +707,21 @@ class TestDetailPage(test_utils.TestCase):
|
|||
addon.save()
|
||||
assert pq(self.client.get(url).content)(selector)
|
||||
|
||||
def test_no_restart(self):
|
||||
no_restart = '<div id="no-restart"'
|
||||
addon = Addon.objects.get(id=3615)
|
||||
url = reverse('addons.detail', args=[addon.slug])
|
||||
f = addon.current_version.all_files[0]
|
||||
|
||||
assert f.no_restart == False
|
||||
r = self.client.get(url)
|
||||
assert no_restart not in r.content
|
||||
|
||||
f.no_restart = True
|
||||
f.save()
|
||||
r = self.client.get(url)
|
||||
self.assertContains(r, no_restart)
|
||||
|
||||
|
||||
class TestTagsBox(test_utils.TestCase):
|
||||
fixtures = ['base/addontag', 'base/apps']
|
||||
|
|
|
@ -3237,3 +3237,16 @@ input.ui-autocomplete-loading {
|
|||
* End Firefox 4 Beta promo styles
|
||||
* TODO remove these when promo is pulled
|
||||
**/
|
||||
|
||||
#no-restart {
|
||||
margin: -1em 0 1.5em 0;
|
||||
}
|
||||
|
||||
#no-restart-msg {
|
||||
border: 1px solid #b6d9e5;
|
||||
border-radius: 3px; /* Only shown in Fx4. */
|
||||
padding: .2em;
|
||||
color: #294473;
|
||||
font-weight: bold;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,13 @@ $(document).ready(function() {
|
|||
|
||||
var etiquette_box = $("#addons-display-review-etiquette").hide();
|
||||
$("#short-review").focus(function() { etiquette_box.show("fast"); } );
|
||||
|
||||
/* No restart required box. (Only shown in Fx4+). */
|
||||
var no_restart = $('#addon-summary #no-restart');
|
||||
if (no_restart.length && z.browser.firefox
|
||||
&& (new VersionCompare()).compareVersions(z.browserVersion, '4.0a1') > 0) {
|
||||
no_restart.show();
|
||||
}
|
||||
});
|
||||
|
||||
/* get satisfaction initialization */
|
||||
|
|
Загрузка…
Ссылка в новой задаче