summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-29 13:53:17 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-01-29 13:53:17 +0000
commitf1aa0df32666931f58b34a21d2e7acf43271fc7a (patch)
tree890de94871f94205851199549e61055ba13d241a /app/views
parentbf76988ebc3efdf5753ee8ae275a2d24b4ab604e (diff)
downloadredmine-f1aa0df32666931f58b34a21d2e7acf43271fc7a.tar.gz
redmine-f1aa0df32666931f58b34a21d2e7acf43271fc7a.zip
Adds an helper to render other formats download links.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2333 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/account/show.rhtml7
-rw-r--r--app/views/boards/index.rhtml8
-rw-r--r--app/views/issues/gantt.rhtml9
-rw-r--r--app/views/issues/index.rhtml12
-rw-r--r--app/views/issues/show.rhtml9
-rw-r--r--app/views/news/index.rhtml7
-rw-r--r--app/views/projects/activity.rhtml7
-rw-r--r--app/views/projects/index.rhtml7
-rw-r--r--app/views/repositories/diff.rhtml7
-rw-r--r--app/views/repositories/revisions.rhtml7
-rw-r--r--app/views/repositories/show.rhtml8
-rw-r--r--app/views/timelog/details.rhtml9
-rw-r--r--app/views/timelog/report.rhtml7
-rw-r--r--app/views/wiki/show.rhtml9
-rw-r--r--app/views/wiki/special_date_index.rhtml9
-rw-r--r--app/views/wiki/special_page_index.rhtml9
16 files changed, 57 insertions, 74 deletions
diff --git a/app/views/account/show.rhtml b/app/views/account/show.rhtml
index d37dcdcf0..649b4b45c 100644
--- a/app/views/account/show.rhtml
+++ b/app/views/account/show.rhtml
@@ -55,10 +55,9 @@
<% end -%>
</div>
-<p class="other-formats">
- <%= l(:label_export_to) %>
- <%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => nil, :user_id => @user, :format => :atom, :key => User.current.rss_key}, :class => 'feed' %>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => nil, :user_id => @user, :key => User.current.rss_key} %>
+<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, :controller => 'projects', :action => 'activity', :user_id => @user, :format => :atom, :key => User.current.rss_key) %>
diff --git a/app/views/boards/index.rhtml b/app/views/boards/index.rhtml
index 655352a96..440a77412 100644
--- a/app/views/boards/index.rhtml
+++ b/app/views/boards/index.rhtml
@@ -29,11 +29,9 @@
</tbody>
</table>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :format => 'atom', :show_messages => 1, :key => User.current.rss_key},
- :class => 'feed' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => @project, :show_messages => 1, :key => User.current.rss_key} %>
+<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:controller => 'projects', :action => 'activity', :id => @project, :format => 'atom', :show_messages => 1, :key => User.current.rss_key}) %>
diff --git a/app/views/issues/gantt.rhtml b/app/views/issues/gantt.rhtml
index b9af1f961..0b38982ce 100644
--- a/app/views/issues/gantt.rhtml
+++ b/app/views/issues/gantt.rhtml
@@ -241,13 +241,10 @@ if Date.today >= @gantt.date_from and Date.today <= @gantt.date_to %>
</tr>
</table>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'PDF', @gantt.params.merge(:format => 'pdf'), :class => 'pdf' %></span>
-<% if @gantt.respond_to?('to_image') %>
-<span><%= link_to 'PNG', @gantt.params.merge(:format => 'png'), :class => 'image' %></span>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'PDF', :url => @gantt.params %>
+ <%= f.link_to('PNG', :url => @gantt.params) if @gantt.respond_to?('to_image') %>
<% end %>
-</p>
<% end # query.valid? %>
<% content_for :sidebar do %>
diff --git a/app/views/issues/index.rhtml b/app/views/issues/index.rhtml
index 7193f674a..64592a5a8 100644
--- a/app/views/issues/index.rhtml
+++ b/app/views/issues/index.rhtml
@@ -44,12 +44,12 @@
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
<p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:query_id => @query, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-<span><%= link_to 'CSV', {:format => 'csv'}, :class => 'csv' %></span>
-<span><%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:query_id => (@query.new_record? ? nil : @query), :key => User.current.rss_key} %>
+ <%= f.link_to 'CSV' %>
+ <%= f.link_to 'PDF' %>
+<% end %>
+
<% end %>
<% end %>
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index 28d656667..57fcb7385 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -108,11 +108,10 @@ end %>
</div>
<% end %>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-<span><%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
+ <%= f.link_to 'PDF' %>
+<% end %>
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
diff --git a/app/views/news/index.rhtml b/app/views/news/index.rhtml
index 70b07081a..826894e08 100644
--- a/app/views/news/index.rhtml
+++ b/app/views/news/index.rhtml
@@ -39,10 +39,9 @@
<% end %>
<p class="pagination"><%= pagination_links_full @news_pages %></p>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:project_id => @project, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
+<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml
index ae893bb60..5174cb33d 100644
--- a/app/views/projects/activity.rhtml
+++ b/app/views/projects/activity.rhtml
@@ -33,10 +33,9 @@
:title => "#{l(:label_date_from)} #{format_date(@date_to)} #{l(:label_date_to).downcase} #{format_date(@date_to + @days - 1)}"}) unless @date_to >= Date.today %>
</div>
&nbsp;
-<p class="other-formats">
- <%= l(:label_export_to) %>
- <%= link_to 'Atom', params.merge(:format => :atom, :from => nil, :key => User.current.rss_key), :class => 'feed' %>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => params.merge(:from => nil, :key => User.current.rss_key) %>
+<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge(:format => 'atom', :from => nil, :key => User.current.rss_key)) %>
diff --git a/app/views/projects/index.rhtml b/app/views/projects/index.rhtml
index 40ea4b862..047d11ff5 100644
--- a/app/views/projects/index.rhtml
+++ b/app/views/projects/index.rhtml
@@ -14,9 +14,8 @@
</p>
<% end %>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
+<% end %>
<% html_title(l(:label_project_plural)) -%>
diff --git a/app/views/repositories/diff.rhtml b/app/views/repositories/diff.rhtml
index 52a5d6057..86102cc52 100644
--- a/app/views/repositories/diff.rhtml
+++ b/app/views/repositories/diff.rhtml
@@ -15,10 +15,9 @@
<%= render :partial => 'common/diff', :locals => {:diff => @diff, :diff_type => @diff_type} %>
<% end -%>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Unified diff', params.merge(:format => 'diff') %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Diff', :url => params, :caption => 'Unified diff' %>
+<% end %>
<% html_title(with_leading_slash(@path), 'Diff') -%>
diff --git a/app/views/repositories/revisions.rhtml b/app/views/repositories/revisions.rhtml
index 8da7d582d..c06c204cd 100644
--- a/app/views/repositories/revisions.rhtml
+++ b/app/views/repositories/revisions.rhtml
@@ -16,9 +16,8 @@
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<% end %>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %>
+<% end %>
<% html_title(l(:label_revision_plural)) -%>
diff --git a/app/views/repositories/show.rhtml b/app/views/repositories/show.rhtml
index 280ae3bdd..943fe9485 100644
--- a/app/views/repositories/show.rhtml
+++ b/app/views/repositories/show.rhtml
@@ -22,10 +22,10 @@
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:action => 'revisions', :id => @project, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-</p>
+
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:action => 'revisions', :id => @project, :key => User.current.rss_key} %>
+<% end %>
<% end %>
<% content_for :header_tags do %>
diff --git a/app/views/timelog/details.rhtml b/app/views/timelog/details.rhtml
index b2aeb86bb..d78b384fd 100644
--- a/app/views/timelog/details.rhtml
+++ b/app/views/timelog/details.rhtml
@@ -22,11 +22,10 @@ already in the URI %>
<%= render :partial => 'list', :locals => { :entries => @entries }%>
<p class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></p>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:issue_id => @issue, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-<span><%= link_to 'CSV', params.merge(:format => 'csv'), :class => 'csv' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => params.merge({:issue_id => @issue, :key => User.current.rss_key}) %>
+ <%= f.link_to 'CSV', :url => params %>
+<% end %>
<% end %>
<% html_title l(:label_spent_time), l(:label_details) %>
diff --git a/app/views/timelog/report.rhtml b/app/views/timelog/report.rhtml
index ad7d79459..f41a1b51a 100644
--- a/app/views/timelog/report.rhtml
+++ b/app/views/timelog/report.rhtml
@@ -65,10 +65,9 @@
</tbody>
</table>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'CSV', params.merge({:format => 'csv'}), :class => 'csv' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'CSV', :url => params %>
+<% end %>
<% end %>
<% end %>
diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml
index 1cb67dfd4..7abfd8a28 100644
--- a/app/views/wiki/show.rhtml
+++ b/app/views/wiki/show.rhtml
@@ -42,11 +42,10 @@
<% end %>
<% end %>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'html' %></span>
-<span><%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'text' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'HTML', :url => {:page => @page.title, :version => @content.version} %>
+ <%= f.link_to 'TXT', :url => {:page => @page.title, :version => @content.version} %>
+<% end %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
diff --git a/app/views/wiki/special_date_index.rhtml b/app/views/wiki/special_date_index.rhtml
index 6717ebc85..008f89293 100644
--- a/app/views/wiki/special_date_index.rhtml
+++ b/app/views/wiki/special_date_index.rhtml
@@ -18,11 +18,10 @@
<% end %>
<% unless @pages.empty? %>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-<span><%= link_to 'HTML', {:action => 'special', :page => 'export'}, :class => 'html' %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :key => User.current.rss_key} %>
+ <%= f.link_to 'HTML', :url => {:action => 'special', :page => 'export'} %>
+<% end %>
<% end %>
<% content_for :header_tags do %>
diff --git a/app/views/wiki/special_page_index.rhtml b/app/views/wiki/special_page_index.rhtml
index 72b395ef7..5547f5b1c 100644
--- a/app/views/wiki/special_page_index.rhtml
+++ b/app/views/wiki/special_page_index.rhtml
@@ -11,11 +11,10 @@
<% end %>
<% unless @pages.empty? %>
-<p class="other-formats">
-<%= l(:label_export_to) %>
-<span><%= link_to 'Atom', {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
-<span><%= link_to 'HTML', {:action => 'special', :page => 'export'} %></span>
-</p>
+<% other_formats_links do |f| %>
+ <%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_pages => 1, :key => User.current.rss_key} %>
+ <%= f.link_to 'HTML', :url => {:action => 'special', :page => 'export'} %>
+<% end %>
<% end %>
<% content_for :header_tags do %>