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
| |   |
| 11 | 11 | Contributors |
| 12 | 12 | ------------- |
| 13 | 13 | |
| 14 | | A number of people have contributed directly to Gitorious by writing documentation |
| 15 | | or developing code and/or graphics. A list of these people in alphabetical order is included |
| 16 | | below: |
| 14 | A number of people have contributed directly to Gitorious by writing documentation |
| 15 | or developing code and/or graphics that the project wishes to thank. |
| 16 | A list of these people in order of appearance: |
| 17 | 17 | |
| 18 | 18 | * David A. Cuadrado <krawek@gmail.com> |
| 19 | 19 | * August Lilleaas <augustlilleaas@gmail.com> |
| 20 | 20 | * Simon Bohlin <simon.bohlin@zondera.com> |
| 21 | 21 | * 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 |
--- a/AUTHORS
+++ b/AUTHORS
@@ -11,13 +11,15 @@ and he remains the project lead.
Contributors
-------------
-A number of people have contributed directly to Gitorious by writing documentation
-or developing code and/or graphics. A list of these people in alphabetical order is included
-below:
+A number of people have contributed directly to Gitorious by writing documentation
+or developing code and/or graphics that the project wishes to thank.
+A list of these people in order of appearance:
* David A. Cuadrado <krawek@gmail.com>
* August Lilleaas <augustlilleaas@gmail.com>
* Simon Bohlin <simon.bohlin@zondera.com>
* Tim Dysinger <tim@dysinger.net>
- * Will <will@gina.alaska. edu>
-
\ No newline at end of file
+ * Dag Odenhall <dag.odenhall@gmail.com>
+ * Will Fisher <will@gina.alaska.edu>
+ * Jonas Fonseca <fonseca@diku.dk>
+ |
| |   |
| 1 | events: |
| 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 | |
| 5 | new-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 | |
| 1 | 12 | (in no particular order) |
| 2 | 13 | |
| 14 | two from Yurii: |
| 15 | 1) show commits actually merged for merge request after actual merge (I see them on open request, but do not on merged one) |
| 16 | 2) 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 |
| 3 | 19 | * 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 |
| 6 | 20 | |
| 7 | 21 | > If you do `git archive --format=tar --prefix=myproject/ HEAD | gzip > |
| 8 | 22 | > myproject.tar.gz`, when .gitattributes specifies files that have |
| … | … | |
| 25 | 25 | > it'd be pretty nice if it did. |
| 26 | 26 | |
| 27 | 27 | * 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 |
| 29 | 28 | * Markdownify atom feed body for projects.atom |
| 30 | 29 | * Make the fact that you _can_ clone/fork any repo more visible, maybe reword it since people confuse it with local cloning |
| 31 | 30 | * Show the most recent mergerequests on users dashboard so they can track them |
| … | … | |
| 40 | 40 | * Nicer diff stats |
| 41 | 41 | * more interesting project stats on frontpage |
| 42 | 42 | * parse git submodule data and link to project if submodule is in gitorious |
| 43 | | * link to users in gitorious in commmits if email match |
| 44 | 43 | * add mainline as a remote branch in clones |
| 45 | 44 | * timezone support |
| 46 | 45 | * Email source_repository owner about merge_request changes |
| toggle raw diff |
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,8 +1,22 @@
+events:
+* 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).
+- maybe save name+email in events table in that case, so we can hook them up to a user later if needed.
+
+new-ui:
+* mandatory project descriptions, at least a sentence or two
+* tweak fonts-sizes and line-heights
+* Clone stats graph on repositories#index
+* popular & active projects on frontpage
+* make the top-header smaller (move gitorious logo to footer?)
+
(in no particular order)
+two from Yurii:
+1) show commits actually merged for merge request after actual merge (I see them on open request, but do not on merged one)
+2) provide clone url on every repo browsing page, so I can get url to pull from even if I am reading a commit
+
+* tree browser: deal better with funny characters: http://gitorious.org/projects/avara/repos/mainline/trees/master
* if you comment on a specific commit, you should get redirected back there
-* graphs should show username (if we have it) for avoiding confusion and for consistency
-** Repository#commit_graph_data_by_author should just use git-shortlog summary instead of jumping through hoops about it
> If you do `git archive --format=tar --prefix=myproject/ HEAD | gzip >
> myproject.tar.gz`, when .gitattributes specifies files that have
@@ -11,7 +25,6 @@
> it'd be pretty nice if it did.
* Deal gracefully with markdown errors (and/or look into using the other markdown libary instead)
-* Don't generate graphs with big "No Data", text even if there's no data
* Markdownify atom feed body for projects.atom
* Make the fact that you _can_ clone/fork any repo more visible, maybe reword it since people confuse it with local cloning
* Show the most recent mergerequests on users dashboard so they can track them
@@ -27,7 +40,6 @@
* Nicer diff stats
* more interesting project stats on frontpage
* parse git submodule data and link to project if submodule is in gitorious
-* link to users in gitorious in commmits if email match
* add mainline as a remote branch in clones
* timezone support
* Email source_repository owner about merge_request changes |
| |   |
| 5 | 5 | session :session_key => '_ks1_session_id', :secret => GitoriousConfig["cookie_secret"] |
| 6 | 6 | include AuthenticatedSystem |
| 7 | 7 | include ExceptionNotifiable |
| 8 | | |
| 8 | |
| 9 | 9 | rescue_from ActiveRecord::RecordNotFound, :with => :render_not_found |
| 10 | 10 | rescue_from ActionController::UnknownController, :with => :render_not_found |
| 11 | 11 | rescue_from ActionController::UnknownAction, :with => :render_not_found |
| 12 | | |
| 12 | |
| 13 | 13 | def rescue_action(exception) |
| 14 | 14 | return super if RAILS_ENV != "production" |
| 15 | | |
| 15 | |
| 16 | 16 | case exception |
| 17 | | # Can't catch RoutingError with rescue_from it seems, |
| 17 | # Can't catch RoutingError with rescue_from it seems, |
| 18 | 18 | # so do it the old-fashioned way |
| 19 | 19 | when ActionController::RoutingError |
| 20 | 20 | render_not_found |
| … | … | |
| 22 | 22 | super |
| 23 | 23 | end |
| 24 | 24 | end |
| 25 | | |
| 25 | |
| 26 | 26 | protected |
| 27 | 27 | def require_user_has_ssh_keys |
| 28 | 28 | unless current_user.ssh_keys.count > 0 |
| 29 | 29 | flash[:error] = "You need to upload your public key first" |
| 30 | 30 | redirect_to new_account_key_path |
| 31 | | return |
| 31 | return |
| 32 | 32 | end |
| 33 | 33 | end |
| 34 | | |
| 34 | |
| 35 | 35 | def find_project |
| 36 | 36 | @project = Project.find_by_slug!(params[:project_id]) |
| 37 | 37 | end |
| 38 | | |
| 38 | |
| 39 | 39 | def find_project_and_repository |
| 40 | 40 | @project = Project.find_by_slug!(params[:project_id]) |
| 41 | 41 | @repository = @project.repositories.find_by_name!(params[:repository_id]) |
| 42 | 42 | end |
| 43 | | |
| 43 | |
| 44 | 44 | def check_repository_for_commits |
| 45 | 45 | unless @repository.has_commits? |
| 46 | 46 | flash[:notice] = "The repository doesn't have any commits yet" |
| 47 | 47 | redirect_to project_repository_path(@project, @repository) and return |
| 48 | 48 | end |
| 49 | 49 | end |
| 50 | | |
| 50 | |
| 51 | 51 | def render_not_found |
| 52 | 52 | render :file => "#{RAILS_ROOT}/public/404.html", :status => 404 |
| 53 | 53 | end |
| toggle raw diff |
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -5,16 +5,16 @@ class ApplicationController < ActionController::Base
session :session_key => '_ks1_session_id', :secret => GitoriousConfig["cookie_secret"]
include AuthenticatedSystem
include ExceptionNotifiable
-
+
rescue_from ActiveRecord::RecordNotFound, :with => :render_not_found
rescue_from ActionController::UnknownController, :with => :render_not_found
rescue_from ActionController::UnknownAction, :with => :render_not_found
-
+
def rescue_action(exception)
return super if RAILS_ENV != "production"
-
+
case exception
- # Can't catch RoutingError with rescue_from it seems,
+ # Can't catch RoutingError with rescue_from it seems,
# so do it the old-fashioned way
when ActionController::RoutingError
render_not_found
@@ -22,32 +22,32 @@ class ApplicationController < ActionController::Base
super
end
end
-
+
protected
def require_user_has_ssh_keys
unless current_user.ssh_keys.count > 0
flash[:error] = "You need to upload your public key first"
redirect_to new_account_key_path
- return
+ return
end
end
-
+
def find_project
@project = Project.find_by_slug!(params[:project_id])
end
-
+
def find_project_and_repository
@project = Project.find_by_slug!(params[:project_id])
@repository = @project.repositories.find_by_name!(params[:repository_id])
end
-
+
def check_repository_for_commits
unless @repository.has_commits?
flash[:notice] = "The repository doesn't have any commits yet"
redirect_to project_repository_path(@project, @repository) and return
end
end
-
+
def render_not_found
render :file => "#{RAILS_ROOT}/public/404.html", :status => 404
end |
| |   |
| 2 | 2 | before_filter :login_required, :only => [:new, :create, :edit, :update, :destroy] |
| 3 | 3 | before_filter :find_project |
| 4 | 4 | before_filter :find_repository |
| 5 | | |
| 5 | |
| 6 | 6 | def index |
| 7 | 7 | @comments = @repository.comments.find(:all, :include => :user) |
| 8 | 8 | @merge_request_count = @repository.merge_requests.count_open |
| … | … | |
| 12 | 12 | format.atom { } |
| 13 | 13 | end |
| 14 | 14 | end |
| 15 | | |
| 15 | |
| 16 | 16 | def commit |
| 17 | 17 | @git = @repository.git |
| 18 | 18 | @commit = @git.commit(params[:sha]) |
| 19 | 19 | @comments = @repository.comments.find_all_by_sha1(params[:sha], :include => :user) |
| 20 | 20 | end |
| 21 | | |
| 21 | |
| 22 | 22 | def new |
| 23 | 23 | @comment = @repository.comments.new |
| 24 | 24 | end |
| 25 | | |
| 25 | |
| 26 | 26 | def create |
| 27 | 27 | @comment = @repository.comments.new(params[:comment]) |
| 28 | 28 | @comment.user = current_user |
| 29 | 29 | @comment.project = @project |
| 30 | 30 | respond_to do |format| |
| 31 | 31 | if @comment.save |
| 32 | @project.create_event(Action::COMMENT, @comment, current_user) |
| 32 | 33 | format.html do |
| 33 | 34 | flash[:success] = "Your comment was added" |
| 34 | 35 | redirect_to project_repository_comments_path(@project, @repository) |
| … | … | |
| 39 | 39 | end |
| 40 | 40 | end |
| 41 | 41 | end |
| 42 | | |
| 42 | |
| 43 | 43 | protected |
| 44 | 44 | def find_repository |
| 45 | 45 | @repository = @project.repositories.find_by_name!(params[:repository_id]) |
| toggle raw diff |
--- a/app/controllers/comments_controller.rb
+++ b/app/controllers/comments_controller.rb
@@ -2,7 +2,7 @@ class CommentsController < ApplicationController
before_filter :login_required, :only => [:new, :create, :edit, :update, :destroy]
before_filter :find_project
before_filter :find_repository
-
+
def index
@comments = @repository.comments.find(:all, :include => :user)
@merge_request_count = @repository.merge_requests.count_open
@@ -12,23 +12,24 @@ class CommentsController < ApplicationController
format.atom { }
end
end
-
+
def commit
@git = @repository.git
@commit = @git.commit(params[:sha])
@comments = @repository.comments.find_all_by_sha1(params[:sha], :include => :user)
end
-
+
def new
@comment = @repository.comments.new
end
-
+
def create
@comment = @repository.comments.new(params[:comment])
@comment.user = current_user
@comment.project = @project
respond_to do |format|
if @comment.save
+ @project.create_event(Action::COMMENT, @comment, current_user)
format.html do
flash[:success] = "Your comment was added"
redirect_to project_repository_comments_path(@project, @repository)
@@ -38,7 +39,7 @@ class CommentsController < ApplicationController
end
end
end
-
+
protected
def find_repository
@repository = @project.repositories.find_by_name!(params[:repository_id]) |
| |   |
| 1 | 1 | class CommittersController < ApplicationController |
| 2 | 2 | before_filter :login_required, :only => [:new, :create, :destroy, :list] |
| 3 | 3 | before_filter :find_project |
| 4 | | before_filter :find_repository, |
| 4 | before_filter :find_repository, |
| 5 | 5 | :only => [:show, :new, :create, :edit, :update, :destroy, :list] |
| 6 | | |
| 6 | |
| 7 | 7 | def new |
| 8 | 8 | @committer = User.new |
| 9 | 9 | end |
| 10 | | |
| 10 | |
| 11 | 11 | def create |
| 12 | 12 | @committer = User.find_by_login(params[:user][:login]) |
| 13 | 13 | unless @committer |
| … | … | |
| 21 | 21 | |
| 22 | 22 | respond_to do |format| |
| 23 | 23 | 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) |
| 24 | 26 | format.html { redirect_to([@repository.project, @repository]) } |
| 25 | | format.xml do |
| 27 | format.xml do |
| 26 | 28 | render :xml => @committer |
| 27 | 29 | end |
| 28 | 30 | else |
| … | … | |
| 34 | 34 | end |
| 35 | 35 | end |
| 36 | 36 | end |
| 37 | | |
| 37 | |
| 38 | 38 | def destroy |
| 39 | 39 | @committership = @repository.committerships.find_by_user_id(params[:id]) |
| 40 | | |
| 40 | |
| 41 | 41 | respond_to do |format| |
| 42 | 42 | if @committership.destroy |
| 43 | @project.create_event(Action::REMOVE_COMMITTER, @repository, current_user, params[:id]) |
| 43 | 44 | flash[:success] = "User removed from repository" |
| 44 | 45 | format.html { redirect_to [@repository.project, @repository] } |
| 45 | 46 | format.xml { render :nothing, :status => :ok } |
| … | … | |
| 48 | 48 | flash[:error] = "Could not remove user from repository" |
| 49 | 49 | format.html { redirect_to [@repository.project, @repository] } |
| 50 | 50 | format.xml { render :nothing, :status => :unprocessable_entity } |
| 51 | | end |
| 52 | | |
| 51 | end |
| 52 | |
| 53 | 53 | end |
| 54 | 54 | end |
| 55 | | |
| 55 | |
| 56 | 56 | def list |
| 57 | 57 | @committers = @repository.committers |
| 58 | 58 | respond_to do |format| |
| 59 | 59 | format.xml { render :xml => @committers } |
| 60 | 60 | end |
| 61 | 61 | end |
| 62 | | |
| 62 | |
| 63 | 63 | def auto_complete_for_user_login |
| 64 | 64 | login = params[:user][:login] |
| 65 | | @users = User.find(:all, |
| 65 | @users = User.find(:all, |
| 66 | 66 | :conditions => [ 'LOWER(login) LIKE ?', '%' + login.downcase + '%' ], |
| 67 | 67 | :limit => 10) |
| 68 | 68 | render :layout => false |
| 69 | 69 | end |
| 70 | | |
| 70 | |
| 71 | 71 | private |
| 72 | 72 | def find_repository |
| 73 | 73 | @repository = @project.repositories.find_by_name!(params[:repository_id]) |
| toggle raw diff |
--- a/app/controllers/committers_controller.rb
+++ b/app/controllers/committers_controller.rb
@@ -1,13 +1,13 @@
class CommittersController < ApplicationController
before_filter :login_required, :only => [:new, :create, :destroy, :list]
before_filter :find_project
- before_filter :find_repository,
+ before_filter :find_repository,
:only => [:show, :new, :create, :edit, :update, :destroy, :list]
-
+
def new
@committer = User.new
end
-
+
def create
@committer = User.find_by_login(params[:user][:login])
unless @committer
@@ -21,8 +21,10 @@ class CommittersController < ApplicationController
respond_to do |format|
if @repository.add_committer(@committer)
+ @committership = @repository.committerships.find_by_user_id(@committer.id)
+ @project.create_event(Action::ADD_COMMITTER, @committership, current_user)
format.html { redirect_to([@repository.project, @repository]) }
- format.xml do
+ format.xml do
render :xml => @committer
end
else
@@ -32,12 +34,13 @@ class CommittersController < ApplicationController
end
end
end
-
+
def destroy
@committership = @repository.committerships.find_by_user_id(params[:id])
-
+
respond_to do |format|
if @committership.destroy
+ @project.create_event(Action::REMOVE_COMMITTER, @repository, current_user, params[:id])
flash[:success] = "User removed from repository"
format.html { redirect_to [@repository.project, @repository] }
format.xml { render :nothing, :status => :ok }
@@ -45,26 +48,26 @@ class CommittersController < ApplicationController
flash[:error] = "Could not remove user from repository"
format.html { redirect_to [@repository.project, @repository] }
format.xml { render :nothing, :status => :unprocessable_entity }
- end
-
+ end
+
end
end
-
+
def list
@committers = @repository.committers
respond_to do |format|
format.xml { render :xml => @committers }
end
end
-
+
def auto_complete_for_user_login
login = params[:user][:login]
- @users = User.find(:all,
+ @users = User.find(:all,
:conditions => [ 'LOWER(login) LIKE ?', '%' + login.downcase + '%' ],
:limit => 10)
render :layout => false
end
-
+
private
def find_repository
@repository = @project.repositories.find_by_name!(params[:repository_id]) |
| |   |
| 1 | 1 | class KeysController < ApplicationController |
| 2 | 2 | before_filter :login_required |
| 3 | | |
| 3 | |
| 4 | 4 | def index |
| 5 | 5 | @ssh_keys = current_user.ssh_keys |
| 6 | 6 | respond_to do |format| |
| … | … | |
| 8 | 8 | format.xml { render :xml => @ssh_keys } |
| 9 | 9 | end |
| 10 | 10 | end |
| 11 | | |
| 11 | |
| 12 | 12 | def new |
| 13 | 13 | @ssh_key = current_user.ssh_keys.new |
| 14 | 14 | end |
| … | … | |
| 24 | 24 | def create |
| 25 | 25 | @ssh_key = current_user.ssh_keys.new |
| 26 | 26 | @ssh_key.key = params[:ssh_key][:key] |
| 27 | | |
| 27 | |
| 28 | 28 | respond_to do |format| |
| 29 | 29 | if @ssh_key.save |
| 30 | 30 | flash[:notice] = "Key added" |
| … | … | |
| 36 | 36 | end |
| 37 | 37 | end |
| 38 | 38 | end |
| 39 | | |
| 39 | |
| 40 | 40 | def show |
| 41 | 41 | @ssh_key = current_user.ssh_keys.find(params[:id]) |
| 42 | | |
| 42 | |
| 43 | 43 | respond_to do |format| |
| 44 | 44 | format.html |
| 45 | 45 | format.xml { render :xml => @ssh_key } |
| 46 | 46 | end |
| 47 | 47 | end |
| 48 | 48 | |
| 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 |
| 50 | 50 | # authorized_keys |
| 51 | 51 | # def edit |
| 52 | 52 | # @ssh_key = current_user.ssh_keys.find(params[:id]) |
| 53 | 53 | # end |
| 54 | | # |
| 54 | # |
| 55 | 55 | # def update |
| 56 | 56 | # @ssh_key = current_user.ssh_keys.find(params[:id]) |
| 57 | 57 | # @ssh_key.key = params[:ssh_key][:key] |
| … | … | |
| 62 | 62 | # render :action => "new" |
| 63 | 63 | # end |
| 64 | 64 | # end |
| 65 | | |
| 65 | |
| 66 | 66 | def destroy |
| 67 | 67 | @ssh_key = current_user.ssh_keys.find(params[:id]) |
| 68 | 68 | if @ssh_key.destroy |
| 69 | 69 | flash[:notice] = "Key removed" |
| 70 | 70 | end |
| 71 | | redirect_to account_path |
| 71 | redirect_to account_path |
| 72 | 72 | end |
| 73 | 73 | end |
| toggle raw diff |
--- a/app/controllers/keys_controller.rb
+++ b/app/controllers/keys_controller.rb
@@ -1,6 +1,6 @@
class KeysController < ApplicationController
before_filter :login_required
-
+
def index
@ssh_keys = current_user.ssh_keys
respond_to do |format|
@@ -8,7 +8,7 @@ class KeysController < ApplicationController
format.xml { render :xml => @ssh_keys }
end
end
-
+
def new
@ssh_key = current_user.ssh_keys.new
end
@@ -24,7 +24,7 @@ class KeysController < ApplicationController
def create
@ssh_key = current_user.ssh_keys.new
@ssh_key.key = params[:ssh_key][:key]
-
+
respond_to do |format|
if @ssh_key.save
flash[:notice] = "Key added"
@@ -36,22 +36,22 @@ class KeysController < ApplicationController
end
end
end
-
+
def show
@ssh_key = current_user.ssh_keys.find(params[:id])
-
+
respond_to do |format|
format.html
format.xml { render :xml => @ssh_key }
end
end
- # can't update keys since yet we'd have to to search/replace through
+ # can't update keys since yet we'd have to to search/replace through
# authorized_keys
# def edit
# @ssh_key = current_user.ssh_keys.find(params[:id])
# end
- #
+ #
# def update
# @ssh_key = current_user.ssh_keys.find(params[:id])
# @ssh_key.key = params[:ssh_key][:key]
@@ -62,12 +62,12 @@ class KeysController < ApplicationController
# render :action => "new"
# end
# end
-
+
def destroy
@ssh_key = current_user.ssh_keys.find(params[:id])
if @ssh_key.destroy
flash[:notice] = "Key removed"
end
- redirect_to account_path
+ redirect_to account_path
end
end |