Skip to content

Commit

Permalink
Add button for reporting issues
Browse files Browse the repository at this point in the history
If the key "issues" is present in showoff.json, then this will present a
button allowing the presenter to file a ticket from the presenter view.

The issues key should be set to a string that points to the ticketing
system. It will be appended with a URI encoded string indicating which
slide the problem is on. This string will then be opened as a URI in a
new window.
  • Loading branch information
binford2k committed Sep 24, 2013
1 parent e93176b commit 8339052
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/showoff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def index(static=false)
end

def presenter
@issues = settings.showoff_config['issues']
erb :presenter
end

Expand Down
4 changes: 4 additions & 0 deletions public/css/showoff.css
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ ul#downloads li {
margin: 0.5em;
}

span#issueUrl {
display: none;
}

/**********************
*** stats page ***
**********************/
Expand Down
8 changes: 8 additions & 0 deletions public/js/presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ $(document).ready(function(){
$(window).resize(function() { zoom(); });

// set up tooltips
$('#report').tipsy({ offset: 5 });
$('#slaveWindow').tipsy({ offset: 5 });
$('#generatePDF').tipsy({ offset: 5 });
$('#onePage').tipsy({ offset: 5, gravity: 'ne' });
Expand Down Expand Up @@ -98,6 +99,13 @@ function popupLoader(elem, page, id, event)
return false;
}

function reportIssue() {
var slide = $("span#slideFile").text();
var issues = $("span#issueUrl").text();
var link = issues + encodeURIComponent('Issue with slide: ' + slide);
window.open(link);
}

function openSlave()
{
try {
Expand Down
5 changes: 5 additions & 0 deletions views/presenter.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<body>

<span id="issueUrl"><%= @issues %></span>

<div id="help">
<table>
<tr><td class="key">z, ?</td><td>toggle help (this)</td></tr>
Expand All @@ -31,6 +33,9 @@
</div>
<span id="links">
<span class="desktop">
<% if @issues %>
<a id="report" href="javascript:reportIssue();" title="Report an issue with the current slide.">Report Issue With Slide</a>
<% end %>
<a id="stats" href="/stats" target="_showoffchild">Viewing Statistics</a>
<a id="downloads" href="/download" target="_showoffchild">Downloads</a>
<a id="slaveWindow" href="javascript:openSlave();" title="Open a slave window or reconnect to existing slave window.">Open Slave Window</a>
Expand Down

0 comments on commit 8339052

Please sign in to comment.