Commit 6c54ea82e81ee2a6ad247328e70b05d95279c0a2
- Date: Sun Apr 27 22:34:50 +0000 2008
- Committer: Johan Sørensen (johan@johansorensen.com)
- Author: Johan Sørensen (johan@johansorensen.com)
- Commit SHA1: 6c54ea82e81ee2a6ad247328e70b05d95279c0a2
- Tree SHA1: 5471a35dbc909a6a47b5561680d5ec5256663ec4
- app/views/repositories/show.atom.builder 19 +++++++++++++++++++
- app/views/projects/show.atom.builder 19 +++++++++++++++++++
- app/controllers/merge_requests_controller.rb 1 +
- app/views/users/show.atom.builder 19 +++++++++++++++++++
- app/controllers/projects_controller.rb 4 -+++
- app/views/repositories/index.html.erb 6 --++++
- app/controllers/repositories_controller.rb 2 -+
- app/controllers/users_controller.rb 6 ++++++
Commit diff
- Diff rendering mode:
- inline
- side by side
app/controllers/merge_requests_controller.rb
|   | ||
| 2 | 2 | before_filter :login_required, :except => [:index, :show] |
| 3 | 3 | before_filter :find_project |
| 4 | 4 | before_filter :find_repository |
| 5 | before_filter :check_repository_for_commits | |
| 5 | 6 | before_filter :find_merge_request, :except => [:index, :show, :new, :create] |
| 6 | 7 | before_filter :assert_merge_request_ownership, :except => [:index, :show, :new, :create, :resolve] |
| 7 | 8 | before_filter :assert_merge_request_resolvable, :only => [:resolve] |
| toggle raw diff | ||
app/controllers/projects_controller.rb
|   | ||
| 35 | 35 | @repositories = @project.repository_clones |
| 36 | 36 | @events = @project.events.paginate(:all, :page => params[:page], |
| 37 | 37 | :order => "created_at desc", :include => [:user, :project]) |
| 38 | @atom_auto_discovery_url = formatted_project_path(@project, :atom) | |
| 38 | 39 | |
| 39 | 40 | respond_to do |format| |
| 40 | 41 | format.html |
| 41 | ||
| 42 | format.xml { render :xml => @project } | |
| 43 | format.atom { } | |
| 42 | 44 | end |
| 43 | 45 | end |
| 44 | 46 | |
| toggle raw diff | ||
app/controllers/repositories_controller.rb
|   | ||
| 18 | 18 | respond_to do |format| |
| 19 | 19 | format.html |
| 20 | 20 | format.xml { render :xml => @repository } |
| 21 | ||
| 21 | format.atom { } | |
| 22 | 22 | end |
| 23 | 23 | end |
| 24 | 24 | |
| toggle raw diff | ||
app/controllers/users_controller.rb
|   | ||
| 14 | 14 | |
| 15 | 15 | @commits_last_week = @user.events.count(:all, |
| 16 | 16 | :conditions => ["created_at > ? AND action = ?", 7.days.ago, Action::COMMIT]) |
| 17 | @atom_auto_discovery_url = formatted_user_path(@user, :atom) | |
| 18 | ||
| 19 | respond_to do |format| | |
| 20 | format.html { } | |
| 21 | format.atom { } | |
| 22 | end | |
| 17 | 23 | end |
| 18 | 24 | |
| 19 | 25 | def create |
| toggle raw diff | ||
app/views/projects/show.atom.builder
|   | ||
| 1 | atom_feed do |feed| | |
| 2 | feed.title("Gitorious: #{@project.slug} activity") | |
| 3 | feed.updated((@events.blank? ? Time.now : @events.first.created_at)) | |
| 4 | ||
| 5 | @events.each do |event| | |
| 6 | action, body, category = action_and_body_for_event(event) | |
| 7 | item_url = "http://#{GitoriousConfig['gitorious_host']}" + project_path(@project) | |
| 8 | feed.entry(event, :url => item_url) do |entry| | |
| 9 | entry.title("#{h(event.user.login)} #{strip_tags(action)}") | |
| 10 | entry.content(<<-EOS, :type => 'html') | |
| 11 | <p>#{link_to event.user.login, user_path(event.user)} #{action}</p> | |
| 12 | <p>#{body}<p> | |
| 13 | EOS | |
| 14 | entry.author do |author| | |
| 15 | author.name(event.user.login) | |
| 16 | end | |
| 17 | end | |
| 18 | end | |
| 19 | end | |
| toggle raw diff | ||
app/views/repositories/index.html.erb
|   | ||
| 15 | 15 | <span class="bignum"><%= repo.events.count -%></span> activities |
| 16 | 16 | </td> |
| 17 | 17 | <td class="branch_count"> |
| 18 | ||
| 18 | <span class="bignum"><%= repo.ready? ? repo.git.heads.size : 0 -%></span> branches | |
| 19 | 19 | </td> |
| 20 | 20 | <td class="author_count"> |
| 21 | ||
| 21 | <span class="bignum"> | |
| 22 | <%= repo.ready? ? repo.commit_graph_data_by_author.keys.size : 0 -%> | |
| 23 | </span> authors | |
| 22 | 24 | </td> |
| 23 | 25 | </tr> |
| 24 | 26 | <tr class="graph"> |
| toggle raw diff | ||
app/views/repositories/show.atom.builder
|   | ||
| 1 | atom_feed do |feed| | |
| 2 | feed.title("Gitorious: #{@project.slug}/#{@repository.name} activity") | |
| 3 | feed.updated((@events.blank? ? Time.now : @events.first.created_at)) | |
| 4 | ||
| 5 | @events.each do |event| | |
| 6 | action, body, category = action_and_body_for_event(event) | |
| 7 | item_url = "http://#{GitoriousConfig['gitorious_host']}" + project_repository_path(@project, @repository) | |
| 8 | feed.entry(event, :url => item_url) do |entry| | |
| 9 | entry.title("#{h(event.user.login)} #{strip_tags(action)}") | |
| 10 | entry.content(<<-EOS, :type => 'html') | |
| 11 | <p>#{link_to event.user.login, user_path(event.user)} #{action}</p> | |
| 12 | <p>#{body}<p> | |
| 13 | EOS | |
| 14 | entry.author do |author| | |
| 15 | author.name(event.user.login) | |
| 16 | end | |
| 17 | end | |
| 18 | end | |
| 19 | end | |
| toggle raw diff | ||
app/views/users/show.atom.builder
|   | ||
| 1 | atom_feed do |feed| | |
| 2 | feed.title("Gitorious: #{@user.login}'s activity") | |
| 3 | feed.updated((@events.blank? ? Time.now : @events.first.created_at)) | |
| 4 | ||
| 5 | @events.each do |event| | |
| 6 | action, body, category = action_and_body_for_event(event) | |
| 7 | item_url = "http://#{GitoriousConfig['gitorious_host']}" + user_path(@user) | |
| 8 | feed.entry(event, :url => item_url) do |entry| | |
| 9 | entry.title("#{h(event.user.login)} #{strip_tags(action)}") | |
| 10 | entry.content(<<-EOS, :type => 'html') | |
| 11 | <p>#{link_to event.user.login, user_path(event.user)} #{action}</p> | |
| 12 | <p>#{body}<p> | |
| 13 | EOS | |
| 14 | entry.author do |author| | |
| 15 | author.name(event.user.login) | |
| 16 | end | |
| 17 | end | |
| 18 | end | |
| 19 | end | |
| toggle raw diff | ||
