Revision 742:2034af722d02
| app/helpers/repositories_helper.rb | ||
|---|---|---|
| 281 | 281 |
) + |
| 282 | 282 |
'<br />' + l(:text_scm_path_encoding_note)) |
| 283 | 283 |
end |
| 284 |
|
|
| 285 |
# Generates a link to a downloadable archive for a revision |
|
| 286 |
# Options: |
|
| 287 |
# * :text - Link text (default to the formatted revision) |
|
| 288 |
def link_to_revision_archive(repository, revision, project, options={})
|
|
| 289 |
method = repository.class.name.demodulize.underscore + "_link_to_revision_archive" |
|
| 290 |
if repository.is_a?(Repository) && |
|
| 291 |
respond_to?(method) && method != 'link_to_revision_archive' |
|
| 292 |
send(method, repository, revision, project, options) |
|
| 293 |
end |
|
| 294 |
end |
|
| 295 |
|
|
| 296 |
def mercurial_link_to_revision_archive(repository, revision, project, options={})
|
|
| 297 |
text = options.delete(:text) || format_revision(revision) |
|
| 298 |
rev = revision.respond_to?(:identifier) ? revision.identifier : revision |
|
| 299 |
if rev.blank? then rev = 'tip' end |
|
| 300 |
content_tag('a', h(text),
|
|
| 301 |
{ :href => "/hg/#{project.identifier}/archive/#{rev}.zip" }.merge(options));
|
|
| 302 |
end |
|
| 303 |
|
|
| 284 | 304 |
end |
| app/views/repositories/_navigation.rhtml | ||
|---|---|---|
| 2 | 2 |
<%= javascript_include_tag 'repository_navigation' %> |
| 3 | 3 |
<% end %> |
| 4 | 4 |
|
| 5 |
<%= link_to l(:label_statistics), {:action => 'stats', :id => @project}, :class => 'icon icon-stats' %>
|
|
| 5 |
<%= link_to_revision_archive(@repository, @changeset, @project, { :text => l(:label_download_revision), :class => 'icon icon-package' }) %>
|
|
| 6 | 6 |
|
| 7 | 7 |
<% form_tag({:action => controller.action_name, :id => @project, :path => to_path_param(@path), :rev => ''}, {:method => :get, :id => 'revision_selector'}) do -%>
|
| 8 | 8 |
<!-- Branches Dropdown --> |
| ... | ... | |
| 19 | 19 |
| <%= l(:label_revision) %>: |
| 20 | 20 |
<%= text_field_tag 'rev', @rev, :size => 8 %> |
| 21 | 21 |
<% end -%> |
| 22 |
|
|
| 23 |
|
|
| app/views/repositories/revision.rhtml | ||
|---|---|---|
| 1 | 1 |
<div class="contextual"> |
| 2 |
|
|
| 3 |
<%= link_to_revision_archive(@repository, @changeset, @project, { :text => l(:label_download_revision), :class => 'icon icon-package' }) %>
|
|
| 4 |
|
|
| 5 |
|
|
| 2 | 6 |
« |
| 3 | 7 |
<% unless @changeset.previous.nil? -%> |
| 4 | 8 |
<%= link_to_revision(@changeset.previous, @project, :text => l(:label_previous)) %> |
| 5 | 9 |
<% else -%> |
| 6 | 10 |
<%= l(:label_previous) %> |
| 7 | 11 |
<% end -%> |
| 8 |
| |
|
| 12 |
|
|
| 9 | 13 |
<% unless @changeset.next.nil? -%> |
| 10 | 14 |
<%= link_to_revision(@changeset.next, @project, :text => l(:label_next)) %> |
| 11 | 15 |
<% else -%> |
| ... | ... | |
| 21 | 25 |
<%= text_field_tag 'rev', @rev, :size => 8 %> |
| 22 | 26 |
<%= submit_tag 'OK', :name => nil %> |
| 23 | 27 |
<% end %> |
| 28 |
|
|
| 24 | 29 |
</div> |
| 25 | 30 |
|
| 26 | 31 |
<h2><%= l(:label_revision) %> <%= format_revision(@changeset) %></h2> |
| app/views/repositories/show.rhtml | ||
|---|---|---|
| 51 | 51 |
:id => @project, :page => nil, :key => User.current.rss_key})) %> |
| 52 | 52 |
<% end %> |
| 53 | 53 |
|
| 54 |
<p class="statistics"> |
|
| 55 |
<%= link_to l(:label_statistics), {:action => 'stats', :id => @project}, :class => 'icon icon-stats' %>
|
|
| 56 |
</p> |
|
| 57 |
|
|
| 54 | 58 |
<% other_formats_links do |f| %> |
| 55 | 59 |
<%= f.link_to 'Atom', :url => {:action => 'revisions', :id => @project, :key => User.current.rss_key} %>
|
| 56 | 60 |
<% end %> |
| 61 |
|
|
| 57 | 62 |
<% end %> |
| 58 | 63 |
<% end %> |
| 59 | 64 |
|
| config/locales/en.yml | ||
|---|---|---|
| 698 | 698 |
label_latest_revision_plural: Latest revisions |
| 699 | 699 |
label_view_revisions: View revisions |
| 700 | 700 |
label_view_all_revisions: View all revisions |
| 701 |
label_download_revision: Download as Zip |
|
| 701 | 702 |
label_max_size: Maximum size |
| 702 | 703 |
label_sort_highest: Move to top |
| 703 | 704 |
label_sort_higher: Move up |
| public/themes/soundsoftware/stylesheets/application.css | ||
|---|---|---|
| 134 | 134 |
#footer { background-color: #fdfbf5; border: 0; border-top: 2px solid #a9b680; color: #3e442c; text-align: right; }
|
| 135 | 135 |
#footer a { color: #be5700; font-weight: bold; }
|
| 136 | 136 |
|
| 137 |
p.statistics { text-align: right; font-size:0.9em; color: #666; }
|
|
| 138 |
|
|
| 137 | 139 |
#main { margin-top: 135px; font:95%; background: #fdfaf0; }
|
| 138 | 140 |
#main a { font-weight: medium; color: #be5700;}
|
| 139 | 141 |
#main a:hover { color: #be5700; text-decoration: underline; }
|
Also available in: Unified diff