1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Use named routes or helpers.

git-svn-id: http://svn.redmine.org/redmine/trunk@13656 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2014-11-26 19:34:33 +00:00
parent 454117a025
commit 1fcbeb6f81
4 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ module AttachmentsHelper
api.filesize attachment.filesize api.filesize attachment.filesize
api.content_type attachment.content_type api.content_type attachment.content_type
api.description attachment.description api.description attachment.description
api.content_url url_for(:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename, :only_path => false) api.content_url download_named_attachment_url(attachment, attachment.filename)
api.author(:id => attachment.author.id, :name => attachment.author.name) if attachment.author api.author(:id => attachment.author.id, :name => attachment.author.name) if attachment.author
api.created_on attachment.created_on api.created_on attachment.created_on
end end

View File

@ -3,7 +3,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title truncate_single_line_raw(@title, 100) xml.title truncate_single_line_raw(@title, 100)
xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false)) xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false))
xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil)) xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil))
xml.id url_for(:controller => 'welcome', :only_path => false) xml.id home_url
xml.icon favicon_url xml.icon favicon_url
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema) xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
xml.author { xml.name "#{Setting.app_title}" } xml.author { xml.name "#{Setting.app_title}" }

View File

@ -2,8 +2,8 @@ xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title @title xml.title @title
xml.link "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false) xml.link "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false)
xml.link "rel" => "alternate", "href" => home_url(:only_path => false) xml.link "rel" => "alternate", "href" => home_url
xml.id url_for(:controller => 'welcome', :only_path => false) xml.id home_url
xml.icon favicon_url xml.icon favicon_url
xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema) xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema)
xml.author { xml.name "#{Setting.app_title}" } xml.author { xml.name "#{Setting.app_title}" }
@ -11,8 +11,8 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
issue = change.issue issue = change.issue
xml.entry do xml.entry do
xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}" xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
xml.link "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false) xml.link "rel" => "alternate", "href" => issue_url(issue)
xml.id url_for(:controller => 'issues' , :action => 'show', :id => issue, :journal_id => change, :only_path => false) xml.id issue_url(issue, :journal_id => change)
xml.updated change.created_on.xmlschema xml.updated change.created_on.xmlschema
xml.author do xml.author do
xml.name change.user.name xml.name change.user.name

View File

@ -2,7 +2,7 @@
<ul> <ul>
<% @issues.each do |issue| -%> <% @issues.each do |issue| -%>
<li><%=h issue.project %> - <%=link_to(h("#{issue.tracker} ##{issue.id}"), :controller => 'issues', :action => 'show', :id => issue, :only_path => false)%>: <%=h issue.subject %></li> <li><%= link_to_issue(issue, :project => true, :only_path => false) %></li>
<% end -%> <% end -%>
</ul> </ul>