summaryrefslogtreecommitdiff
path: root/app/helpers/issues_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-04 22:14:20 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-04 22:14:20 +0200
commitd31d711a70779132ea43387f93eb4ccc1e472761 (patch)
tree815c0ae6a327e2937482a43d2b21cf15ac6871c0 /app/helpers/issues_helper.rb
parenta46fe875c6aea206e575e2b083bd31ed36ee1b1e (diff)
downloadgitlab-ce-d31d711a70779132ea43387f93eb4ccc1e472761.tar.gz
DRY and refactor atom code
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r--app/helpers/issues_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index d513e0ba58e..a5b393c1e3c 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -113,4 +113,19 @@ module IssuesHelper
'issue-box-open'
end
end
+
+ def issue_to_atom(xml, issue)
+ xml.entry do
+ xml.id project_issue_url(issue.project, issue)
+ xml.link href: project_issue_url(issue.project, issue)
+ xml.title truncate(issue.title, length: 80)
+ xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ")
+ xml.media :thumbnail, width: "40", height: "40", url: avatar_icon(issue.author_email)
+ xml.author do |author|
+ xml.name issue.author_name
+ xml.email issue.author_email
+ end
+ xml.summary issue.title
+ end
+ end
end