Skip to content

Commit

Permalink
GUI: summary_view: show last granted time for tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
tserong committed Mar 16, 2012
1 parent 92cb5ec commit 2eb0ec4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hawk/app/views/main/_gettext.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ var GETTEXT = {
ticket_revoked: function() {
return "<%= escape_javascript _('Revoked') %>";
},
ticket_last_granted: function(d) {
return "<%= escape_javascript _('Last granted: %s') % '_DATETIME_' %>".replace('_DATETIME_', d);
},
// View switcher
summary_view: function() {
return "<%= escape_javascript _('Summary View') %>";
Expand Down
3 changes: 3 additions & 0 deletions hawk/public/javascripts/status-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ var summary_view = {
d.attr("class", "ui-corner-all " + status_class).css("display", display);
d.find("span").html(label);
$("#itemlist").append(d);
if (this["last-granted"]) {
flag_info("ticket::" + id, GETTEXT.ticket_last_granted(new Date(this["last-granted"] * 1000)));
}
});
self._show_counters("#ticketsum");
}
Expand Down
13 changes: 13 additions & 0 deletions hawk/public/javascripts/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ function flag_error(id, failed_ops) {
}
}

// Mark items with some info rollover (single string, dumb as a sack of rocks;
// use either flag_error or flag_info, *not* both at the same time)
// TODO(should): add a separate info icon so we can have both error and info
function flag_info(id, info) {
if (info) {
$(jq(id+"::error")).addClass("ui-icon ui-icon-info");
$(jq(id+"::error")).attr("title", info);
} else {
$(jq(id+"::error")).removeClass("ui-icon ui-icon-info");
$(jq(id+"::error")).removeAttr("title");
}
}

// title: dialog title
// id: node or resource id
// type: either "node" or "resource"
Expand Down

0 comments on commit 2eb0ec4

Please sign in to comment.