Skip to content

Commit

Permalink
Version notes in Review Queue (bug 669481)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoberger committed Jul 11, 2011
1 parent 0a8bf45 commit 9b563d9
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 5 deletions.
7 changes: 7 additions & 0 deletions apps/editors/templates/editors/queue.html
Expand Up @@ -162,6 +162,11 @@ <h3>
{% for value in row %}
<td>{{ value|xssafe }}</td>
{% endfor %}
<td>
<div class="addon-version-notes">
<a href="#" class="ed-sprite-notes app-icon" title="{{ _('Version Notes') }}">&nbsp;</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
Expand All @@ -185,4 +190,6 @@ <h3>
<a href="http://wiki.mozilla.org/Update:Editors">{{ _("Editors' Guide") }}</a>
</div>

<div class="popup" id="popup-notes" data-url="{{ url('editors.queue_version_notes') }}"></div>

{% endblock %}
2 changes: 2 additions & 0 deletions apps/editors/urls.py
Expand Up @@ -20,6 +20,8 @@
url(r'^logs$', views.eventlog, name='editors.eventlog'),
url(r'^log/(\d+)$', views.eventlog_detail, name='editors.eventlog.detail'),
url(r'^reviewlog$', views.reviewlog, name='editors.reviewlog'),
url(r'^queue_version_notes/%s?$' % ADDON_ID, views.queue_version_notes,
name='editors.queue_version_notes'),
url(r'^queue_viewing$', views.queue_viewing,
name='editors.queue_viewing'),
url(r'^review_viewing$', views.review_viewing,
Expand Down
12 changes: 11 additions & 1 deletion apps/editors/views.py
Expand Up @@ -17,7 +17,7 @@
import amo
from access import acl
from addons.decorators import addon_view
from addons.models import Version
from addons.models import Addon, Version
from amo.decorators import login_required, json_view, post_required
from amo.utils import paginate
from amo.urlresolvers import reverse
Expand Down Expand Up @@ -503,6 +503,16 @@ def queue_viewing(request):

return viewing


@json_view
@editor_required
def queue_version_notes(request, addon_id):
addon = get_object_or_404(Addon, pk=addon_id)
version = addon.latest_version
return {'releasenotes': unicode(version.releasenotes),
'approvalnotes': version.approvalnotes}


@editor_required
def reviewlog(request):
data = request.GET.copy()
Expand Down
23 changes: 19 additions & 4 deletions media/css/zamboni/editors.css
Expand Up @@ -13,10 +13,11 @@
.app-icon, .platform-icon {
float: left;
margin-right: 4px;
background: url(../../img/developers/editor-sprite.png?1) no-repeat top left;
background: url(../../img/developers/editor-sprite.png?2) no-repeat top left;
width: 16px; height: 16px;
position: relative;
top: 4px;
text-decoration: none;
}
.ed-sprite-admin-review { background-position: 0 0; }
.ed-sprite-firefox { background-position: 0 -66px; }
Expand All @@ -28,9 +29,10 @@
.ed-sprite-thunderbird { background-position: 0 -563px; }
.ed-sprite-jetpack { background-position: 0 -629px; }
.ed-sprite-restartless { background-position: 0 -695px; }
.ed-sprite-notes { background-position: 0 -827px; }

.platform-icon {
background: url(../../img/developers/platforms.png?1) no-repeat top left;
background: url(../../img/developers/platforms.png?2) no-repeat top left;
}
.plat-sprite-all { background-position: 0 0; }
.plat-sprite-any { background-position: 0 0; }
Expand All @@ -44,7 +46,7 @@
.plat-sprite-maemo { background-position: 0 -128px; }

.sort-icon {
background: url(../../img/developers/editor-sprite.png?1) no-repeat top left;
background: url(../../img/developers/editor-sprite.png?2) no-repeat top left;
}
.ed-sprite-sort-asc {
background-position: right -321px;
Expand Down Expand Up @@ -165,10 +167,23 @@ table.data-grid .addon-locked {
top: 4px;
}
table.data-grid .locked .addon-locked {
background: url(../../img/developers/editor-sprite.png?1) no-repeat top left;
background: url(../../img/developers/editor-sprite.png?2) no-repeat top left;
background-position: 0 -761px;
}

/* Version notes */
#popup_notes .version_notes {
overflow: auto;
max-height: 200px;
margin-bottom: 1em;
}
.addon-version-notes {
position: relative;
}
table.data-grid .addon-version-notes a {
text-decoration: none;
}

/* editors/queue tabs */
ul.tabnav {
list-style-type: none;
Expand Down
Binary file modified media/img/developers/editor-sprite.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions media/js/zamboni/editors.js
Expand Up @@ -230,6 +230,35 @@ function initQueue() {
setTimeout(checkCurrentlyViewing, 2000);
});
})();

var pop = $('#popup-notes').hide(),
loadNotes = function(e) {
var addon_id = $(e.click_target).closest('tr').attr('data-addon');
pop.html(gettext('Loading&hellip;'));
$.get(pop.attr('data-url') + addon_id, function(data) {
pop.html('');
var empty = true;
if(data.releasenotes) {
pop.append($('<strong>', {text: gettext('Release Notes')}));
pop.append($('<div>', {class:'version_notes', text: data.releasenotes}));
empty = false;
}
if(data.approvalnotes) {
pop.append($('<strong>', {text: gettext('Approval Notes')}));
pop.append($('<div>', {class:'version_notes', text: data.approvalnotes}));
empty = false;
}
if(empty) {
pop.append($('<em>', {text: gettext('No version notes found')}));
}
});
return true;
}

$('.addon-version-notes a').each(function(i, el) {
$(pop).popup(el, { pointTo: el, callback: loadNotes, width: 500});
});

}


Expand Down

0 comments on commit 9b563d9

Please sign in to comment.