System notice: In light of the Debian OpenSSL security issue we've regenerated the server keys. See this thread for instructions and the new key fingerprints.

Commit 2984296f69b4e46a675f65a15cb444e734eceb55

Merge branch 'master' into sonian

* master: (100 commits)
chomped whitespace
updated todo
FIXED: order events desc
color code various events just a tiny bit
Smaller more matching feed icon
html escape commits in events
Made the user feed a member action, since usernames can contain dots
output less from rebuild_events
Updated TODO
commits-by-author graph should use gitorious username (if found)
Disabling readme rendering until we decided on the specifics
Fixed event display of commit message. TODO updated
atom feed for /events.
simple_format for event body
Fixed formatted user path, Make (more) visible the atom feed for activities
Sanitize the README content
Added method to link file path to blob
Render README for repositories
fix submenu positioning in webkit
Simplify rounded corners css, and add webkit support
...

Conflicts:

app/views/repositories/_infobox.html.erb

Commit diff

AUTHORS

 
1111Contributors
1212-------------
1313
14A number of people have contributed directly to Gitorious by writing documentation
15or developing code and/or graphics. A list of these people in alphabetical order is included
16below:
14A number of people have contributed directly to Gitorious by writing documentation
15or developing code and/or graphics that the project wishes to thank.
16A list of these people in order of appearance:
1717
1818 * David A. Cuadrado <krawek@gmail.com>
1919 * August Lilleaas <augustlilleaas@gmail.com>
2020 * Simon Bohlin <simon.bohlin@zondera.com>
2121 * Tim Dysinger <tim@dysinger.net>
22 * Will <will@gina.alaska. edu>
23
22 * Dag Odenhall <dag.odenhall@gmail.com>
23 * Will Fisher <will@gina.alaska.edu>
24 * Jonas Fonseca <fonseca@diku.dk>
25
toggle raw diff

TODO.txt

 
1events:
2* need to create user-less events even we don't find matching users, otherwise it gets weird whenever there's commits from non-registered gitorious users (or users commit from another email).
3- maybe save name+email in events table in that case, so we can hook them up to a user later if needed.
4
5new-ui:
6* mandatory project descriptions, at least a sentence or two
7* tweak fonts-sizes and line-heights
8* Clone stats graph on repositories#index
9* popular & active projects on frontpage
10* make the top-header smaller (move gitorious logo to footer?)
11
112(in no particular order)
213
14two from Yurii:
151) show commits actually merged for merge request after actual merge (I see them on open request, but do not on merged one)
162) provide clone url on every repo browsing page, so I can get url to pull from even if I am reading a commit
17
18* tree browser: deal better with funny characters: http://gitorious.org/projects/avara/repos/mainline/trees/master
319* if you comment on a specific commit, you should get redirected back there
4* graphs should show username (if we have it) for avoiding confusion and for consistency
5** Repository#commit_graph_data_by_author should just use git-shortlog summary instead of jumping through hoops about it
620
721> If you do `git archive --format=tar --prefix=myproject/ HEAD | gzip >
822> myproject.tar.gz`, when .gitattributes specifies files that have
2525> it'd be pretty nice if it did.
2626
2727* Deal gracefully with markdown errors (and/or look into using the other markdown libary instead)
28* Don't generate graphs with big "No Data", text even if there's no data
2928* Markdownify atom feed body for projects.atom
3029* Make the fact that you _can_ clone/fork any repo more visible, maybe reword it since people confuse it with local cloning
3130* Show the most recent mergerequests on users dashboard so they can track them
4040* Nicer diff stats
4141* more interesting project stats on frontpage
4242* parse git submodule data and link to project if submodule is in gitorious
43* link to users in gitorious in commmits if email match
4443* add mainline as a remote branch in clones
4544* timezone support
4645* Email source_repository owner about merge_request changes
toggle raw diff

app/controllers/accounts_controller.rb

 
11class AccountsController < ApplicationController
22 before_filter :login_required
3
3
44 def show
55 end
6
7 def edit
8 @user = current_user
6
7 def edit
8 @user = current_user
99 end
10
10
1111 def update
1212 @user = current_user
1313 @user.attributes = params[:user]
1818 render :action => "edit"
1919 end
2020 end
21
21
2222 def password
2323 @user = current_user
2424 end
25
25
2626 def update_password
2727 @user = current_user
2828 if User.authenticate(current_user.email, params[:user][:current_password])
toggle raw diff

app/controllers/application.rb

 
55 session :session_key => '_ks1_session_id', :secret => GitoriousConfig["cookie_secret"]
66 include AuthenticatedSystem
77 include ExceptionNotifiable
8
8
99 rescue_from ActiveRecord::RecordNotFound, :with => :render_not_found
1010 rescue_from ActionController::UnknownController, :with => :render_not_found
1111 rescue_from ActionController::UnknownAction, :with => :render_not_found
12
12
1313 def rescue_action(exception)
1414 return super if RAILS_ENV != "production"
15
15
1616 case exception
17 # Can't catch RoutingError with rescue_from it seems,
17 # Can't catch RoutingError with rescue_from it seems,
1818 # so do it the old-fashioned way
1919 when ActionController::RoutingError
2020 render_not_found
2222 super
2323 end
2424 end
25
25
2626 protected
2727 def require_user_has_ssh_keys
2828 unless current_user.ssh_keys.count > 0
2929 flash[:error] = "You need to upload your public key first"
3030 redirect_to new_account_key_path
31 return
31 return
3232 end
3333 end
34
34
3535 def find_project
3636 @project = Project.find_by_slug!(params[:project_id])
3737 end
38
38
3939 def find_project_and_repository
4040 @project = Project.find_by_slug!(params[:project_id])
4141 @repository = @project.repositories.find_by_name!(params[:repository_id])
4242 end
43
43
4444 def check_repository_for_commits
4545 unless @repository.has_commits?
4646 flash[:notice] = "The repository doesn't have any commits yet"
4747 redirect_to project_repository_path(@project, @repository) and return
4848 end
4949 end
50
50
5151 def render_not_found
5252 render :file => "#{RAILS_ROOT}/public/404.html", :status => 404
5353 end
toggle raw diff

app/controllers/blobs_controller.rb

 
11class BlobsController < ApplicationController
22 before_filter :find_project_and_repository
33 before_filter :check_repository_for_commits
4
4
55
66 def show
77 @git = @repository.git
3232 end
3333 render :text => @blob.data, :content_type => @blob.mime_type
3434 end
35
35
3636 # def text
3737 # end
3838end
toggle raw diff

app/controllers/comments_controller.rb

 
22 before_filter :login_required, :only => [:new, :create, :edit, :update, :destroy]
33 before_filter :find_project
44 before_filter :find_repository
5
5
66 def index
77 @comments = @repository.comments.find(:all, :include => :user)
88 @merge_request_count = @repository.merge_requests.count_open
1212 format.atom { }
1313 end
1414 end
15
15
1616 def commit
1717 @git = @repository.git
1818 @commit = @git.commit(params[:sha])
1919 @comments = @repository.comments.find_all_by_sha1(params[:sha], :include => :user)
2020 end
21
21
2222 def new
2323 @comment = @repository.comments.new
2424 end
25
25
2626 def create
2727 @comment = @repository.comments.new(params[:comment])
2828 @comment.user = current_user
2929 @comment.project = @project
3030 respond_to do |format|
3131 if @comment.save
32 @project.create_event(Action::COMMENT, @comment, current_user)
3233 format.html do
3334 flash[:success] = "Your comment was added"
3435 redirect_to project_repository_comments_path(@project, @repository)
3939 end
4040 end
4141 end
42
42
4343 protected
4444 def find_repository
4545 @repository = @project.repositories.find_by_name!(params[:repository_id])
toggle raw diff

app/controllers/commits_controller.rb

 
11class CommitsController < ApplicationController
22 before_filter :find_project_and_repository
33 before_filter :check_repository_for_commits
4
4
55 def index
66 redirect_to project_repository_log_path(@project, @repository, @repository.head_candidate.name)
77 end
1717 # TODO: format.diff { render :content_type => "text/plain" }
1818 end
1919 end
20
20
2121end
toggle raw diff

app/controllers/committers_controller.rb

 
11class CommittersController < ApplicationController
22 before_filter :login_required, :only => [:new, :create, :destroy, :list]
33 before_filter :find_project
4 before_filter :find_repository,
4 before_filter :find_repository,
55 :only => [:show, :new, :create, :edit, :update, :destroy, :list]
6
6
77 def new
88 @committer = User.new
99 end
10
10
1111 def create
1212 @committer = User.find_by_login(params[:user][:login])
1313 unless @committer
2121
2222 respond_to do |format|
2323 if @repository.add_committer(@committer)
24 @committership = @repository.committerships.find_by_user_id(@committer.id)
25 @project.create_event(Action::ADD_COMMITTER, @committership, current_user)
2426 format.html { redirect_to([@repository.project, @repository]) }
25 format.xml do
27 format.xml do
2628 render :xml => @committer
2729 end
2830 else
3434 end
3535 end
3636 end
37
37
3838 def destroy
3939 @committership = @repository.committerships.find_by_user_id(params[:id])
40
40
4141 respond_to do |format|
4242 if @committership.destroy
43 @project.create_event(Action::REMOVE_COMMITTER, @repository, current_user, params[:id])
4344 flash[:success] = "User removed from repository"
4445 format.html { redirect_to [@repository.project, @repository] }
4546 format.xml { render :nothing, :status => :ok }
4848 flash[:error] = "Could not remove user from repository"
4949 format.html { redirect_to [@repository.project, @repository] }
5050 format.xml { render :nothing, :status => :unprocessable_entity }
51 end
52
51 end
52
5353 end
5454 end
55
55
5656 def list
5757 @committers = @repository.committers
5858 respond_to do |format|
5959 format.xml { render :xml => @committers }
6060 end
6161 end
62
62
6363 def auto_complete_for_user_login
6464 login = params[:user][:login]
65 @users = User.find(:all,
65 @users = User.find(:all,
6666 :conditions => [ 'LOWER(login) LIKE ?', '%' + login.downcase + '%' ],
6767 :limit => 10)
6868 render :layout => false
6969 end
70
70
7171 private
7272 def find_repository
7373 @repository = @project.repositories.find_by_name!(params[:repository_id])
toggle raw diff

app/controllers/events_controller.rb

 
1class EventsController < ApplicationController
2 def index
3 @events = Event.paginate(:all, :order => "events.created_at desc",
4 :page => params[:page], :include => [:user])
5 @atom_auto_discovery_url = formatted_events_path(:atom)
6
7 respond_to do |if_format_is|
8 if_format_is.html {}
9 if_format_is.atom {}
10 end
11 end
12
13end
toggle raw diff

app/controllers/keys_controller.rb

 
11class KeysController < ApplicationController
22 before_filter :login_required
3
3
44 def index
55 @ssh_keys = current_user.ssh_keys
66 respond_to do |format|
88 format.xml { render :xml => @ssh_keys }
99 end
1010 end
11
11
1212 def new
1313 @ssh_key = current_user.ssh_keys.new
1414 end
2424 def create
2525 @ssh_key = current_user.ssh_keys.new
2626 @ssh_key.key = params[:ssh_key][:key]
27
27
2828 respond_to do |format|
2929 if @ssh_key.save
3030 flash[:notice] = "Key added"
3636 end
3737 end
3838 end
39
39
4040 def show
4141 @ssh_key = current_user.ssh_keys.find(params[:id])
42
42
4343 respond_to do |format|
4444 format.html
4545 format.xml { render :xml => @ssh_key }
4646 end
4747 end
4848
49 # can't update keys since yet we'd have to to search/replace through
49 # can't update keys since yet we'd have to to search/replace through
5050 # authorized_keys
5151 # def edit
5252 # @ssh_key = current_user.ssh_keys.find(params[:id])
5353 # end
54 #
54 #
5555 # def update
5656 # @ssh_key = current_user.ssh_keys.find(params[:id])
5757 # @ssh_key.key = params[:ssh_key][:key]
6262 # render :action => "new"
6363 # end
6464 # end
65
65
6666 def destroy
6767 @ssh_key = current_user.ssh_keys.find(params[:id])
6868 if @ssh_key.destroy
6969 flash[:notice] = "Key removed"
7070 end
71 redirect_to account_path
71 redirect_to account_path
7272 end
7373end
toggle raw diff

app/controllers/logs_controller.rb

 
11class LogsController < ApplicationController
22 before_filter :find_project_and_repository
33 before_filter :check_repository_for_commits
4
4
55 def index
66 redirect_to project_repository_log_path(@project, @repository, @repository.head_candidate.name)
77 end
8
8
99 def show
1010 @git = @repository.git
1111 @commits = @repository.paginated_commits(params[:id], params[:page])
1414 format.html
1515 end