diff --git a/.foreman b/.foreman index 549e85b1490dfaa5b551b4654eff464344b76f04..87c3f5a1c158686373e3179b503b0a7b7987587b 100644 --- a/.foreman +++ b/.foreman @@ -1 +1 @@ -port: 9999 +port: 3000 diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 29fcb52eb9732c9e31524caef4f83540d5144c6d..1e859ceac31135e6c0edfad4a56c6933204d8353 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -68,7 +68,7 @@ class ProjectsController < ApplicationController def show return render "projects/empty" unless @project.repo_exists? && @project.has_commits? - limit = (params[:limit] || 10).to_i + limit = (params[:limit] || 20).to_i @activities = @project.cached_updates(limit) end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index c0652cbeab99aca05dd4915d6412a466e6bff3bb..9a112f4674fc44311049d6ad3926902ae2d67cd0 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -9,7 +9,7 @@ class RepositoriesController < ApplicationController layout "project" def show - @activities = @project.fresh_commits(10) + @activities = @project.fresh_commits(20) end def branches diff --git a/app/views/hooks/_data_ex.html.erb b/app/views/hooks/_data_ex.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..f212bb2dc0b7666cfb9c448ac63c883b0574d469 --- /dev/null +++ b/app/views/hooks/_data_ex.html.erb @@ -0,0 +1,42 @@ +<% data_ex_str = < "95790bf891e76fee5e1747ab589903a6a1f80f22", + :after => "da1560886d4f094c3e6c9ef40349f7d38b5d27d7", + :ref => "refs/heads/master", + :repository => { + :name => "Diaspora", + :url => "localhost/diaspora", + :description => "", + :homepage => "localhost/diaspora", + :private => true + }, + :commits => [ + [0] { + :id => "450d0de7532f8b663b9c5cce183b...", + :message => "Update Catalan translation to e38cb41.", + :timestamp => "2011-12-12T14:27:31+02:00", + :url => "http://localhost/diaspora/commits/450d0de7532f...", + :author => { + :name => "Jordi Mallach", + :email => "jordi@softcatala.org" + } + }, + + .... + + [3] { + :id => "da1560886d4f094c3e6c9ef40349...", + :message => "fixed readme", + :timestamp => "2012-01-03T23:36:29+02:00", + :url => "http://localhost/diaspora/commits/da1560886d...", + :author => { + :name => "gitlab dev user", + :email => "gitlabdev@dv6700.(none)" + } + } + ] +} +eos +%> +<% js_lexer = Pygments::Lexer[:js] %> +<%= raw js_lexer.highlight(data_ex_str) %> diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index b0795ad4b2fd20c8fd5d6acc5b3db01be4081188..e149f4fc7675b9ee5eb44c44e04d3e04e6c860cc 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -1,4 +1,8 @@ = render "repositories/head" + + + + .right= link_to "Add new", new_project_hook_path(@project), :class => "grey-button append-bottom-10" - unless @hooks.empty? %div.update-data.ui-box.ui-box-small @@ -14,3 +18,13 @@ - else %h3 No hooks +.clear +%h3 Help +%p + Post receive hooks. For now only POST request allowed. We send some data with request. Example below + +.view_file + .view_file_header + %strong POST data passed + .data.no-padding + = render "data_ex" diff --git a/app/views/hooks/show.html.haml b/app/views/hooks/show.html.haml index 6bc1132de27f9a9fad4de8d4786cc11ed0dbd9ef..47c1ddeac40c1027379d09c2807be93847b847d9 100644 --- a/app/views/hooks/show.html.haml +++ b/app/views/hooks/show.html.haml @@ -1,5 +1,8 @@ = render "repositories/head" -%h3= @hook.url +%h3 + %span.commit.tag POST + = @hook.url + - if can? current_user, :admin_project, @project .merge-tabs diff --git a/config/database.yml b/config/database.yml index 51a4dd459dc12673ad440debb28f499c89550022..ff126d9ce705d9086e4ca07ea5bbafe94d96a4b5 100644 --- a/config/database.yml +++ b/config/database.yml @@ -20,6 +20,6 @@ test: production: adapter: sqlite3 - database: db/production.sqlite3 + database: db/development.sqlite3 pool: 5 timeout: 5000