Commit 473efc82b68dcaac61be55466e423fdbbabde710
1 parent
8812d9de
Exists in
master
and in
4 other branches
Group and team rss is valid now
Showing
10 changed files
with
51 additions
and
29 deletions
Show diff stats
app/assets/stylesheets/gitlab_bootstrap/mixins.scss
app/views/commits/_head.html.haml
... | ... | @@ -23,6 +23,5 @@ |
23 | 23 | |
24 | 24 | - if current_controller?(:commits) && current_user.private_token |
25 | 25 | %li.pull-right |
26 | - %span.rss-icon | |
27 | - = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do | |
28 | - = image_tag "rss_ui.png", title: "feed" | |
26 | + = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do | |
27 | + %i.icon-rss | ... | ... |
app/views/dashboard/show.atom.builder
1 | 1 | xml.instruct! |
2 | 2 | xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do |
3 | 3 | xml.title "Dashboard feed#{" - #{current_user.name}" if current_user.name.present?}" |
4 | - xml.link :href => projects_url(:atom), :rel => "self", :type => "application/atom+xml" | |
5 | - xml.link :href => projects_url, :rel => "alternate", :type => "text/html" | |
4 | + xml.link :href => dashboard_url(:atom), :rel => "self", :type => "application/atom+xml" | |
5 | + xml.link :href => dashboard_url, :rel => "alternate", :type => "text/html" | |
6 | 6 | xml.id projects_url |
7 | 7 | xml.updated @events.maximum(:updated_at).strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? |
8 | 8 | ... | ... |
app/views/groups/show.atom.builder
1 | 1 | xml.instruct! |
2 | 2 | xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do |
3 | - xml.title "Dashboard feed#{" - #{current_user.name}" if current_user.name.present?}" | |
4 | - xml.link :href => projects_url(:atom), :rel => "self", :type => "application/atom+xml" | |
5 | - xml.link :href => projects_url, :rel => "alternate", :type => "text/html" | |
3 | + xml.title "Group feed - #{@group.name}" | |
4 | + xml.link :href => group_path(@group, :atom), :rel => "self", :type => "application/atom+xml" | |
5 | + xml.link :href => group_path(@group), :rel => "alternate", :type => "text/html" | |
6 | 6 | xml.id projects_url |
7 | 7 | xml.updated @events.maximum(:updated_at).strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? |
8 | 8 | ... | ... |
app/views/groups/show.html.haml
... | ... | @@ -16,11 +16,11 @@ |
16 | 16 | .description.well.light |
17 | 17 | = @group.description |
18 | 18 | = render "projects", projects: @projects |
19 | - %div | |
20 | - %span.rss-icon | |
21 | - = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do | |
22 | - = image_tag "rss_ui.png", title: "feed" | |
23 | - %strong News Feed | |
19 | + .prepend-top-20 | |
20 | + = link_to group_path(@group, { format: :atom, private_token: current_user.private_token }), title: "Feed" do | |
21 | + %strong | |
22 | + %i.icon-rss | |
23 | + News Feed | |
24 | 24 | |
25 | 25 | %hr |
26 | 26 | .gitlab-promo | ... | ... |
app/views/issues/_head.html.haml
... | ... | @@ -6,6 +6,5 @@ |
6 | 6 | = nav_link(controller: :labels) do |
7 | 7 | = link_to 'Labels', project_labels_path(@project), class: "tab" |
8 | 8 | %li.pull-right |
9 | - %span.rss-icon | |
10 | - = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do | |
11 | - = image_tag "rss_ui.png", title: "feed" | |
9 | + = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do | |
10 | + %i.icon-rss | ... | ... |
... | ... | @@ -0,0 +1,29 @@ |
1 | +xml.instruct! | |
2 | +xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do | |
3 | + xml.title "Team feed - #{@team.name}" | |
4 | + xml.link :href => team_url(@team, :atom), :rel => "self", :type => "application/atom+xml" | |
5 | + xml.link :href => team_url(@team), :rel => "alternate", :type => "text/html" | |
6 | + xml.id projects_url | |
7 | + xml.updated @events.maximum(:updated_at).strftime("%Y-%m-%dT%H:%M:%SZ") if @events.any? | |
8 | + | |
9 | + @events.each do |event| | |
10 | + if event.proper? | |
11 | + event = EventDecorator.decorate(event) | |
12 | + xml.entry do | |
13 | + event_link = event.feed_url | |
14 | + event_title = event.feed_title | |
15 | + | |
16 | + xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}" | |
17 | + xml.link :href => event_link | |
18 | + xml.title truncate(event_title, :length => 80) | |
19 | + xml.updated event.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") | |
20 | + xml.media :thumbnail, :width => "40", :height => "40", :url => gravatar_icon(event.author_email) | |
21 | + xml.author do |author| | |
22 | + xml.name event.author_name | |
23 | + xml.email event.author_email | |
24 | + end | |
25 | + xml.summary event_title | |
26 | + end | |
27 | + end | |
28 | + end | |
29 | +end | ... | ... |
app/views/teams/show.html.haml
... | ... | @@ -15,11 +15,11 @@ |
15 | 15 | .description.well.light |
16 | 16 | = @team.description |
17 | 17 | = render "projects", projects: @projects |
18 | - %div | |
19 | - %span.rss-icon | |
20 | - = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do | |
21 | - = image_tag "rss_ui.png", title: "feed" | |
22 | - %strong News Feed | |
18 | + .prepend-top-20 | |
19 | + = link_to team_path(@team, { format: :atom, private_token: current_user.private_token }), title: "Feed" do | |
20 | + %strong | |
21 | + %i.icon-rss | |
22 | + News Feed | |
23 | 23 | |
24 | 24 | %hr |
25 | 25 | .gitlab-promo | ... | ... |
config/routes.rb
... | ... | @@ -135,7 +135,7 @@ Gitlab::Application.routes.draw do |
135 | 135 | # |
136 | 136 | # Groups Area |
137 | 137 | # |
138 | - resources :groups, constraints: { id: /[^\/]+/ } do | |
138 | + resources :groups, constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} do | |
139 | 139 | member do |
140 | 140 | get :issues |
141 | 141 | get :merge_requests |
... | ... | @@ -148,7 +148,7 @@ Gitlab::Application.routes.draw do |
148 | 148 | # |
149 | 149 | # Teams Area |
150 | 150 | # |
151 | - resources :teams, constraints: { id: /[^\/]+/ } do | |
151 | + resources :teams, constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/} do | |
152 | 152 | member do |
153 | 153 | get :issues |
154 | 154 | get :merge_requests | ... | ... |
features/teams/team.feature
... | ... | @@ -4,11 +4,6 @@ Feature: UserTeams |
4 | 4 | And I own project "Shop" |
5 | 5 | And project "Shop" has push event |
6 | 6 | |
7 | - Scenario: No teams, no dashboard info block | |
8 | - When I do not have teams with me | |
9 | - And I visit dashboard page | |
10 | - Then I should see dashboard page without teams info block | |
11 | - | |
12 | 7 | Scenario: I should see teams info block |
13 | 8 | When I have teams with my membership |
14 | 9 | And I visit dashboard page | ... | ... |