link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options)
end
+ # Generates a link to a SCM revision
+ # Options:
+ # * :text - Link text (default to the formatted revision)
+ def link_to_revision(revision, project, options={})
+ text = options.delete(:text) || format_revision(revision)
+
+ link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => revision}, :title => l(:label_revision_id, revision))
+ end
+
def toggle_link(name, id, options={})
onclick = "Element.toggle('#{id}'); "
onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
</td>
<td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
-<td class="revision"><%= link_to(format_revision(entry.lastrev.name), :action => 'revision', :id => @project, :rev => entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %></td>
+<td class="revision"><%= link_to_revision(changeset.revision, @project) if changeset %></td>
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
<td class="author"><%= changeset.nil? ? h(entry.lastrev.author.to_s.split('<').first) : changeset.author if entry.lastrev %></td>
<td class="comments"><%=h truncate(changeset.comments, :length => 50) unless changeset.nil? %></td>
<% line_num = 1 %>
<% revisions.each do |changeset| %>
<tr class="changeset <%= cycle 'odd', 'even' %>">
-<td class="id"><%= link_to format_revision(changeset.revision), :action => 'revision', :id => project, :rev => changeset.revision %></td>
+<td class="id"><%= link_to_revision(changeset.revision, project) %></td>
<td class="checkbox"><%= radio_button_tag('rev', changeset.revision, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < revisions.size) %></td>
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.revision, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %></td>
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
<div class="contextual">
«
<% unless @changeset.previous.nil? -%>
- <%= link_to l(:label_previous), :controller => 'repositories', :action => 'revision', :id => @project, :rev => @changeset.previous.revision %>
+ <%= link_to_revision(@changeset.previous.revision, @project, :text => l(:label_previous)) %>
<% else -%>
<%= l(:label_previous) %>
<% end -%>
|
<% unless @changeset.next.nil? -%>
- <%= link_to l(:label_next), :controller => 'repositories', :action => 'revision', :id => @project, :rev => @changeset.next.revision %>
+ <%= link_to_revision(@changeset.next.revision, @project, :text => l(:label_next)) %>
<% else -%>
<%= l(:label_next) %>
<% end -%>
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
label_tag: Tag
label_revision: Revision
label_revision_plural: Revisions
+ label_revision_id: "Revision {{value}}"
label_associated_revisions: Associated revisions
label_added: added
label_modified: modified
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
enumeration_system_activity: Activité système
setting_gravatar_default: Default Gravatar image
setting_start_of_week: Start calendars on
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
label_update_issue_done_ratios: Update issue done ratios
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
enumeration_system_activity: 系統活動
+ label_revision_id: Revision {{value}}
setting_start_of_week: Start calendars on
permission_view_issues: View Issues
label_display_used_statuses_only: Only display statuses that are used by this tracker
+ label_revision_id: Revision {{value}}