diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-21 16:57:01 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-23 17:11:39 +0200 |
commit | a6dfd065ca9de2e421425a5126c68bf8949ce110 (patch) | |
tree | 45eaaf341b8c746cc69b28f207544fa9fc7e421e /app/views | |
parent | 72b090b890fc438923b9bcb35d0461564f71cebc (diff) | |
download | gitlab-ce-a6dfd065ca9de2e421425a5126c68bf8949ce110.tar.gz |
Add atom feed for project activity.
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/projects/show.atom.builder | 12 | ||||
-rw-r--r-- | app/views/projects/show.html.haml | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/app/views/projects/show.atom.builder b/app/views/projects/show.atom.builder new file mode 100644 index 00000000000..c2d909d7ebd --- /dev/null +++ b/app/views/projects/show.atom.builder @@ -0,0 +1,12 @@ +xml.instruct! +xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do + xml.title "Project feed - #{@project.name}" + xml.link href: namespace_project_path(@project.namespace, @project, :atom), rel: "self", type: "application/atom+xml" + xml.link href: namespace_project_path(@project.namespace, @project), rel: "alternate", type: "text/html" + xml.id projects_url + xml.updated @events.maximum(:updated_at).strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? + + @events.each do |event| + event_to_atom(xml, event) + end +end diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 864bda359b6..e9d4fdc96e1 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -1,3 +1,7 @@ += content_for :meta_tags do + - if current_user + = auto_discovery_link_tag(:atom, namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "#{@group.name} activity") + - if current_user && can?(current_user, :download_code, @project) = render 'shared/no_ssh' = render 'shared/no_password' @@ -39,6 +43,14 @@ %i.fa.fa-angle-left %section.col-md-9 = render "events/event_last_push", event: @last_push + + - if current_user + %ul.nav.nav-pills.event_filter.pull-right + %li + = link_to namespace_project_path(@project.namespace, @project, format: :atom, private_token: current_user.private_token), title: "Feed", class: 'rss-btn' do + %i.fa.fa-rss + News Feed + = render 'shared/event_filter' %hr .content_list |