##// END OF EJS Templates
Use named routes or helpers....
Jean-Philippe Lang -
r13274:1fcbeb6f816a
parent child
Show More
@@ -1,47 +1,47
1 1 # encoding: utf-8
2 2 #
3 3 # Redmine - project management software
4 4 # Copyright (C) 2006-2014 Jean-Philippe Lang
5 5 #
6 6 # This program is free software; you can redistribute it and/or
7 7 # modify it under the terms of the GNU General Public License
8 8 # as published by the Free Software Foundation; either version 2
9 9 # of the License, or (at your option) any later version.
10 10 #
11 11 # This program is distributed in the hope that it will be useful,
12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 14 # GNU General Public License for more details.
15 15 #
16 16 # You should have received a copy of the GNU General Public License
17 17 # along with this program; if not, write to the Free Software
18 18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 19
20 20 module AttachmentsHelper
21 21 # Displays view/delete links to the attachments of the given object
22 22 # Options:
23 23 # :author -- author names are not displayed if set to false
24 24 # :thumbails -- display thumbnails if enabled in settings
25 25 def link_to_attachments(container, options = {})
26 26 options.assert_valid_keys(:author, :thumbnails)
27 27
28 28 if container.attachments.any?
29 29 options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)
30 30 render :partial => 'attachments/links',
31 31 :locals => {:attachments => container.attachments, :options => options, :thumbnails => (options[:thumbnails] && Setting.thumbnails_enabled?)}
32 32 end
33 33 end
34 34
35 35 def render_api_attachment(attachment, api)
36 36 api.attachment do
37 37 api.id attachment.id
38 38 api.filename attachment.filename
39 39 api.filesize attachment.filesize
40 40 api.content_type attachment.content_type
41 41 api.description attachment.description
42 api.content_url url_for(:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename, :only_path => false)
42 api.content_url download_named_attachment_url(attachment, attachment.filename)
43 43 api.author(:id => attachment.author.id, :name => attachment.author.name) if attachment.author
44 44 api.created_on attachment.created_on
45 45 end
46 46 end
47 47 end
@@ -1,32 +1,32
1 1 xml.instruct!
2 2 xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
3 3 xml.title truncate_single_line_raw(@title, 100)
4 4 xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false))
5 5 xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil))
6 xml.id url_for(:controller => 'welcome', :only_path => false)
6 xml.id home_url
7 7 xml.icon favicon_url
8 8 xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
9 9 xml.author { xml.name "#{Setting.app_title}" }
10 10 xml.generator(:uri => Redmine::Info.url) { xml.text! Redmine::Info.app_name; }
11 11 @items.each do |item|
12 12 xml.entry do
13 13 url = url_for(item.event_url(:only_path => false))
14 14 if @project
15 15 xml.title truncate_single_line_raw(item.event_title, 100)
16 16 else
17 17 xml.title truncate_single_line_raw("#{item.project} - #{item.event_title}", 100)
18 18 end
19 19 xml.link "rel" => "alternate", "href" => url
20 20 xml.id url
21 21 xml.updated item.event_datetime.xmlschema
22 22 author = item.event_author if item.respond_to?(:event_author)
23 23 xml.author do
24 24 xml.name(author)
25 25 xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
26 26 end if author
27 27 xml.content "type" => "html" do
28 28 xml.text! textilizable(item, :event_description, :only_path => false)
29 29 end
30 30 end
31 31 end
32 32 end
@@ -1,31 +1,31
1 1 xml.instruct!
2 2 xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
3 3 xml.title @title
4 4 xml.link "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false)
5 xml.link "rel" => "alternate", "href" => home_url(:only_path => false)
6 xml.id url_for(:controller => 'welcome', :only_path => false)
5 xml.link "rel" => "alternate", "href" => home_url
6 xml.id home_url
7 7 xml.icon favicon_url
8 8 xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema)
9 9 xml.author { xml.name "#{Setting.app_title}" }
10 10 @journals.each do |change|
11 11 issue = change.issue
12 12 xml.entry do
13 13 xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
14 xml.link "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
15 xml.id url_for(:controller => 'issues' , :action => 'show', :id => issue, :journal_id => change, :only_path => false)
14 xml.link "rel" => "alternate", "href" => issue_url(issue)
15 xml.id issue_url(issue, :journal_id => change)
16 16 xml.updated change.created_on.xmlschema
17 17 xml.author do
18 18 xml.name change.user.name
19 19 xml.email(change.user.mail) if change.user.is_a?(User) && !change.user.mail.blank? && !change.user.pref.hide_mail
20 20 end
21 21 xml.content "type" => "html" do
22 22 xml.text! '<ul>'
23 23 details_to_strings(change.details, false).each do |string|
24 24 xml.text! '<li>' + string + '</li>'
25 25 end
26 26 xml.text! '</ul>'
27 27 xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
28 28 end
29 29 end
30 30 end
31 31 end
@@ -1,9 +1,9
1 1 <p><%= l(:mail_body_reminder, :count => @issues.size, :days => @days) %></p>
2 2
3 3 <ul>
4 4 <% @issues.each do |issue| -%>
5 <li><%=h issue.project %> - <%=link_to(h("#{issue.tracker} ##{issue.id}"), :controller => 'issues', :action => 'show', :id => issue, :only_path => false)%>: <%=h issue.subject %></li>
5 <li><%= link_to_issue(issue, :project => true, :only_path => false) %></li>
6 6 <% end -%>
7 7 </ul>
8 8
9 9 <p><%= link_to l(:label_issue_view_all), @issues_url %></p>
General Comments 0
You need to be logged in to leave comments. Login now