Skip to content

Commit

Permalink
Adding download link to documents/show. Uses clippy and swfobject. [#…
Browse files Browse the repository at this point in the history
…2 state:resolved]
  • Loading branch information
bamnet committed Apr 28, 2010
1 parent c0b3ba8 commit e0bdb04
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -10,3 +10,6 @@
[submodule "vendor/plugins/authenticates_access"]
path = vendor/plugins/authenticates_access
url = git://github.com/mikldt/authenticates_access.git
[submodule "vendor/other/clippy"]
path = vendor/other/clippy
url = http://github.com/mojombo/clippy.git
9 changes: 9 additions & 0 deletions app/views/documents/show.html.erb
Expand Up @@ -87,6 +87,15 @@
<div id="dl-link"><div id="dl-link-padding">
<%= link_to "Download File", download_document_revision_path(@document, 'current') unless @document.current_revision.blank? %>
<span class="details">from <%= @document.current_revision.user.full_name unless @document.user.blank? %> on <%= @document.current_revision.created_at.strftime('%D') unless @document.current_revision.blank?%></span>
<span id="clippy"></span>
<% content_for :head do %>
<%= javascript_include_tag "swfobject.js" %>
<% end %>
<script type="text/javascript">
var flashvars = { text: "<%= download_document_revision_path(@document, 'current', :only_path => false) %>" };
var params = { bgcolor: "#EDEDED", scale: "noscale", quality: "high" };
swfobject.embedSWF("<%= compute_public_path('clippy.swf','') %>", "clippy", "110", "14", "9.0.0", '', flashvars, params);
</script>
</div></div>
<div id="dl-revs">
<% if @document.revisions.size > 1 %>
Expand Down
1 change: 1 addition & 0 deletions public/clippy.swf
4 changes: 4 additions & 0 deletions public/javascripts/swfobject.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/other/clippy
Submodule clippy added at 7329b7

0 comments on commit e0bdb04

Please sign in to comment.