From 2adbb3b3455563a3a7ef2ba4e7f31194df95e0ab Mon Sep 17 00:00:00 2001 From: Tom Van Looy Date: Wed, 21 Mar 2012 13:53:38 +0100 Subject: [PATCH 01/15] $ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz --2012-03-21 13:52:34-- http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz Resolving ftp.ruby-lang.org... 221.186.184.68 Connecting to ftp.ruby-lang.org|221.186.184.68|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/x-tar] Saving to: `ruby-1.9.2-p290.tar.gz' [ <=> ] 54,691,840 3.37M/s in 18s 2012-03-21 13:52:53 (2.85 MB/s) - `ruby-1.9.2-p290.tar.gz' saved [54691840] [tom.vanlooy@itr232l ~/Desktop] $ file ruby-1.9.2-p290.tar.gz ruby-1.9.2-p290.tar.gz: POSIX tar archive (GNU) --- doc/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/installation.md b/doc/installation.md index 22205af9..823bd483 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -60,7 +60,7 @@ The installation consists of 6 steps: # 2. Install ruby wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz - tar xfvz ruby-1.9.2-p290.tar.gz + tar xfv ruby-1.9.2-p290.tar.gz cd ruby-1.9.2-p290 ./configure make From 8bb4c6de5649f4ecc3970c48c45ec5e207c556c5 Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Wed, 21 Mar 2012 23:59:12 +0200 Subject: [PATCH 02/15] improve how to merge tips --- app/views/merge_requests/_how_to_merge.html.haml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/merge_requests/_how_to_merge.html.haml b/app/views/merge_requests/_how_to_merge.html.haml index 5cf5e5bc..61b4f0aa 100644 --- a/app/views/merge_requests/_how_to_merge.html.haml +++ b/app/views/merge_requests/_how_to_merge.html.haml @@ -5,11 +5,10 @@ .modal-body %pre :erb + git checkout <%= @merge_request.target_branch %> git fetch origin - git checkout -b <%=@merge_request.source_branch%> origin/<%=@merge_request.source_branch%> - git checkout <%=@merge_request.target_branch%> - git merge <%=@merge_request.source_branch%> - git push origin <%=@merge_request.target_branch%> + git merge origin/<%= @merge_request.source_branch %> + git push origin <%= @merge_request.target_branch %> :javascript From 039b6db483fff2aaeaa19a46018232626e6a0eba Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Thu, 22 Mar 2012 00:09:53 +0200 Subject: [PATCH 03/15] design improve of form of key --- app/assets/stylesheets/common.scss | 6 +++++- app/views/keys/_form.html.haml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index ddf74db5..723f8501 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1003,4 +1003,8 @@ p.time { color: #999; line-height: 16px; font-weight:bold; -} +} + +.thin_area{ + height: 150px; +} diff --git a/app/views/keys/_form.html.haml b/app/views/keys/_form.html.haml index cdabdc73..c25e8d07 100644 --- a/app/views/keys/_form.html.haml +++ b/app/views/keys/_form.html.haml @@ -11,7 +11,7 @@ .input= f.text_field :title .clearfix = f.label :key - .input= f.text_area :key, :class => "xlarge" + .input= f.text_area :key, :class => [:xxlarge, :thin_area] .actions = f.submit 'Save', :class => "primary btn" = link_to "Cancel", keys_path, :class => "btn" From 6e5999a69b660aa482872743533ed0340994e535 Mon Sep 17 00:00:00 2001 From: randx Date: Thu, 22 Mar 2012 00:09:54 +0200 Subject: [PATCH 04/15] CHANGELOG, VERSION updated to 2.3 --- CHANGELOG | 29 ++++++++++++++++++++++++++++- VERSION | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 0f13f46d..417def7f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,33 @@ +v 2.3.0 + - Dashboard r1 + - Search r1 + - Project page + - Close merge request on push + - Persist MR diff after merge + - mysql support + - Documentation + +v 2.2.0 + - We’ve added support of LDAP auth + - Improved permission logic (4 roles system) + - Protected branches (now only masters can push to protected branches) + - Usability improved + - twitter bootstrap integrated + - compare view between commits + - wiki feature + - now you can enable/disable issues, wiki, wall features per project + - security fixes + - improved code browsing (ajax branch switch etc) + - improved per-line commenting + - git submodules displayed + - moved to rails 3.2 + - help section improved + v 2.1.0 - Project tab r1 - - Repository tab r1 + - List branches/tags + - per line comments + - mass user import v 2.0.0 - gitolite as main git host system diff --git a/VERSION b/VERSION index caf684d4..276cbf9e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.3.0pre +2.3.0 From 1fefd7cbd3ef65d34c36f2b4dd8cedb29200c569 Mon Sep 17 00:00:00 2001 From: randx Date: Thu, 22 Mar 2012 00:09:55 +0200 Subject: [PATCH 05/15] Fix db seeds for dev --- db/fixtures/development/004_teams.rb | 4 ++-- db/fixtures/development/005_issues.rb | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/db/fixtures/development/004_teams.rb b/db/fixtures/development/004_teams.rb index 3ef55b92..5af98b92 100644 --- a/db/fixtures/development/004_teams.rb +++ b/db/fixtures/development/004_teams.rb @@ -1,7 +1,7 @@ UsersProject.seed(:id, [ { :id => 1, :project_id => 1, :user_id => 1, :project_access => UsersProject::MASTER }, - { :id => 2, :project_id => 1, :user_id => 2, :project_access => UsersProject::REPORTERW}, - { :id => 3, :project_id => 1, :user_id => 3, :project_access => UsersProject::REPORTERW}, + { :id => 2, :project_id => 1, :user_id => 2, :project_access => UsersProject::REPORTER}, + { :id => 3, :project_id => 1, :user_id => 3, :project_access => UsersProject::REPORTER}, { :id => 4, :project_id => 1, :user_id => 4, :project_access => UsersProject::REPORTER}, { :id => 5, :project_id => 1, :user_id => 5, :project_access => UsersProject::REPORTER}, diff --git a/db/fixtures/development/005_issues.rb b/db/fixtures/development/005_issues.rb index cab6f574..32375387 100644 --- a/db/fixtures/development/005_issues.rb +++ b/db/fixtures/development/005_issues.rb @@ -15,7 +15,25 @@ Issue.seed(:id, [ { :id => 13, :project_id => 3, :author_id => 2, :assignee_id => 2, :title => Faker::Lorem.sentence(6)}, { :id => 14, :project_id => 3, :author_id => 3, :assignee_id => 3, :title => Faker::Lorem.sentence(6)}, { :id => 15, :project_id => 3, :author_id => 4, :assignee_id => 4, :title => Faker::Lorem.sentence(6)}, - { :id => 16, :project_id => 3, :author_id => 5, :assignee_id => 5, :title => Faker::Lorem.sentence(6)} + { :id => 16, :project_id => 3, :author_id => 5, :assignee_id => 5, :title => Faker::Lorem.sentence(6)}, + + { :id => 21, :project_id => 1, :author_id => 1, :assignee_id => 1, :title => Faker::Lorem.sentence(6) }, + { :id => 22, :project_id => 1, :author_id => 2, :assignee_id => 2, :title => Faker::Lorem.sentence(6) }, + { :id => 23, :project_id => 1, :author_id => 3, :assignee_id => 3, :title => Faker::Lorem.sentence(6) }, + { :id => 24, :project_id => 1, :author_id => 4, :assignee_id => 4, :title => Faker::Lorem.sentence(6) }, + { :id => 25, :project_id => 1, :author_id => 5, :assignee_id => 5, :title => Faker::Lorem.sentence(6) }, + + { :id => 26, :project_id => 2, :author_id => 1, :assignee_id => 1, :title => Faker::Lorem.sentence(6) }, + { :id => 27, :project_id => 2, :author_id => 2, :assignee_id => 2, :title => Faker::Lorem.sentence(6) }, + { :id => 28, :project_id => 2, :author_id => 3, :assignee_id => 3, :title => Faker::Lorem.sentence(6) }, + { :id => 29, :project_id => 2, :author_id => 4, :assignee_id => 4, :title => Faker::Lorem.sentence(6) }, + { :id => 30, :project_id => 2, :author_id => 5, :assignee_id => 5, :title => Faker::Lorem.sentence(6) }, + + { :id => 32, :project_id => 3, :author_id => 1, :assignee_id => 1, :title => Faker::Lorem.sentence(6)}, + { :id => 33, :project_id => 3, :author_id => 2, :assignee_id => 2, :title => Faker::Lorem.sentence(6)}, + { :id => 34, :project_id => 3, :author_id => 3, :assignee_id => 3, :title => Faker::Lorem.sentence(6)}, + { :id => 35, :project_id => 3, :author_id => 4, :assignee_id => 4, :title => Faker::Lorem.sentence(6)}, + { :id => 36, :project_id => 3, :author_id => 5, :assignee_id => 5, :title => Faker::Lorem.sentence(6)} ]) From 755a894c911d6eb5604b97bee758306c41cd8d4a Mon Sep 17 00:00:00 2001 From: randx Date: Thu, 22 Mar 2012 00:09:56 +0200 Subject: [PATCH 06/15] Issues pagination --- app/assets/stylesheets/common.scss | 31 ++++++++++++++++++- app/controllers/issues_controller.rb | 2 +- app/views/admin/projects/index.html.haml | 2 +- app/views/admin/users/index.html.haml | 2 +- app/views/issues/_issues.html.haml | 2 ++ app/views/issues/index.html.haml | 1 - .../{ => admin}/_first_page.html.haml | 0 app/views/kaminari/{ => admin}/_gap.html.haml | 0 .../kaminari/{ => admin}/_last_page.html.haml | 0 .../kaminari/{ => admin}/_next_page.html.haml | 0 .../kaminari/{ => admin}/_page.html.haml | 0 .../kaminari/{ => admin}/_paginator.html.haml | 0 .../kaminari/{ => admin}/_prev_page.html.haml | 0 .../kaminari/gitlab/_first_page.html.haml | 9 ++++++ app/views/kaminari/gitlab/_gap.html.haml | 8 +++++ .../kaminari/gitlab/_last_page.html.haml | 9 ++++++ .../kaminari/gitlab/_next_page.html.haml | 9 ++++++ app/views/kaminari/gitlab/_page.html.haml | 10 ++++++ .../kaminari/gitlab/_paginator.html.haml | 18 +++++++++++ .../kaminari/gitlab/_prev_page.html.haml | 9 ++++++ 20 files changed, 107 insertions(+), 5 deletions(-) rename app/views/kaminari/{ => admin}/_first_page.html.haml (100%) rename app/views/kaminari/{ => admin}/_gap.html.haml (100%) rename app/views/kaminari/{ => admin}/_last_page.html.haml (100%) rename app/views/kaminari/{ => admin}/_next_page.html.haml (100%) rename app/views/kaminari/{ => admin}/_page.html.haml (100%) rename app/views/kaminari/{ => admin}/_paginator.html.haml (100%) rename app/views/kaminari/{ => admin}/_prev_page.html.haml (100%) create mode 100644 app/views/kaminari/gitlab/_first_page.html.haml create mode 100644 app/views/kaminari/gitlab/_gap.html.haml create mode 100644 app/views/kaminari/gitlab/_last_page.html.haml create mode 100644 app/views/kaminari/gitlab/_next_page.html.haml create mode 100644 app/views/kaminari/gitlab/_page.html.haml create mode 100644 app/views/kaminari/gitlab/_paginator.html.haml create mode 100644 app/views/kaminari/gitlab/_prev_page.html.haml diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 723f8501..a729dfe0 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -461,8 +461,27 @@ img.lil_av { border-top:none; form { - padding-top:16px; + padding:9px 0; + margin:0px; } + + .pills { + li { + padding:3px 0; + &.active a { background-color:$style_color; } + a { + border-radius:7px; + } + } + } + } + + &.bottom { + padding: 0 10px; + background:#f5f5f5; + border-top: 1px solid #eee; + @include round-borders-bottom(4px); + border-bottom:none; } &.padded { @@ -1008,3 +1027,13 @@ p.time { .thin_area{ height: 150px; } + +.gitlab_pagination { + span { + padding:0 10px; + + a { + color:$link_color; + } + } +} diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 53d8b74d..1fc59d98 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -28,7 +28,7 @@ class IssuesController < ApplicationController when 2 then @project.issues.closed when 3 then @project.issues.opened.assigned(current_user) else @project.issues.opened - end + end.page(params[:page]).per(10) @issues = @issues.includes(:author, :project) diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 7cda5220..079ae385 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -19,4 +19,4 @@ %td= last_commit(project) %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small" %td= link_to 'Destroy', [:admin, project], :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger" -= paginate @admin_projects += paginate @admin_projects, :theme => "admin" diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index a0b4df1f..19eb6478 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -20,4 +20,4 @@ %td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small" %td= link_to 'Destroy', [:admin, user], :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger" -= paginate @admin_users += paginate @admin_users, :theme => "admin" diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index bf863a2d..f18cbe20 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -3,3 +3,5 @@ - @issues.non_critical.each do |issue| = render(:partial => 'issues/show', :locals => {:issue => issue}) + +%li= paginate @issues, :remote => true, :theme => "gitlab" diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index e55cae1f..283e936e 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -38,7 +38,6 @@ - if @issues.blank? %li %p.padded Nothing to show here - :javascript var href = $('.issue_search').parent().attr('action'); var last_terms = ''; diff --git a/app/views/kaminari/_first_page.html.haml b/app/views/kaminari/admin/_first_page.html.haml similarity index 100% rename from app/views/kaminari/_first_page.html.haml rename to app/views/kaminari/admin/_first_page.html.haml diff --git a/app/views/kaminari/_gap.html.haml b/app/views/kaminari/admin/_gap.html.haml similarity index 100% rename from app/views/kaminari/_gap.html.haml rename to app/views/kaminari/admin/_gap.html.haml diff --git a/app/views/kaminari/_last_page.html.haml b/app/views/kaminari/admin/_last_page.html.haml similarity index 100% rename from app/views/kaminari/_last_page.html.haml rename to app/views/kaminari/admin/_last_page.html.haml diff --git a/app/views/kaminari/_next_page.html.haml b/app/views/kaminari/admin/_next_page.html.haml similarity index 100% rename from app/views/kaminari/_next_page.html.haml rename to app/views/kaminari/admin/_next_page.html.haml diff --git a/app/views/kaminari/_page.html.haml b/app/views/kaminari/admin/_page.html.haml similarity index 100% rename from app/views/kaminari/_page.html.haml rename to app/views/kaminari/admin/_page.html.haml diff --git a/app/views/kaminari/_paginator.html.haml b/app/views/kaminari/admin/_paginator.html.haml similarity index 100% rename from app/views/kaminari/_paginator.html.haml rename to app/views/kaminari/admin/_paginator.html.haml diff --git a/app/views/kaminari/_prev_page.html.haml b/app/views/kaminari/admin/_prev_page.html.haml similarity index 100% rename from app/views/kaminari/_prev_page.html.haml rename to app/views/kaminari/admin/_prev_page.html.haml diff --git a/app/views/kaminari/gitlab/_first_page.html.haml b/app/views/kaminari/gitlab/_first_page.html.haml new file mode 100644 index 00000000..fee8112f --- /dev/null +++ b/app/views/kaminari/gitlab/_first_page.html.haml @@ -0,0 +1,9 @@ +-# Link to the "First" page +-# available local variables +-# url: url to the first page +-# current_page: a page object for the currently displayed page +-# num_pages: total number of pages +-# per_page: number of items to fetch per page +-# remote: data-remote +%span.first + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote diff --git a/app/views/kaminari/gitlab/_gap.html.haml b/app/views/kaminari/gitlab/_gap.html.haml new file mode 100644 index 00000000..f82f185a --- /dev/null +++ b/app/views/kaminari/gitlab/_gap.html.haml @@ -0,0 +1,8 @@ +-# Non-link tag that stands for skipped pages... +-# available local variables +-# current_page: a page object for the currently displayed page +-# num_pages: total number of pages +-# per_page: number of items to fetch per page +-# remote: data-remote +%span.page.gap + = raw(t 'views.pagination.truncate') diff --git a/app/views/kaminari/gitlab/_last_page.html.haml b/app/views/kaminari/gitlab/_last_page.html.haml new file mode 100644 index 00000000..6e41d232 --- /dev/null +++ b/app/views/kaminari/gitlab/_last_page.html.haml @@ -0,0 +1,9 @@ +-# Link to the "Last" page +-# available local variables +-# url: url to the last page +-# current_page: a page object for the currently displayed page +-# num_pages: total number of pages +-# per_page: number of items to fetch per page +-# remote: data-remote +%span.last + = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} diff --git a/app/views/kaminari/gitlab/_next_page.html.haml b/app/views/kaminari/gitlab/_next_page.html.haml new file mode 100644 index 00000000..e87ab4e0 --- /dev/null +++ b/app/views/kaminari/gitlab/_next_page.html.haml @@ -0,0 +1,9 @@ +-# Link to the "Next" page +-# available local variables +-# url: url to the next page +-# current_page: a page object for the currently displayed page +-# num_pages: total number of pages +-# per_page: number of items to fetch per page +-# remote: data-remote +%span.next + = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote diff --git a/app/views/kaminari/gitlab/_page.html.haml b/app/views/kaminari/gitlab/_page.html.haml new file mode 100644 index 00000000..528bba8f --- /dev/null +++ b/app/views/kaminari/gitlab/_page.html.haml @@ -0,0 +1,10 @@ +-# Link showing page number +-# available local variables +-# page: a page object for "this" page +-# url: url to this page +-# current_page: a page object for the currently displayed page +-# num_pages: total number of pages +-# per_page: number of items to fetch per page +-# remote: data-remote +%span{:class => "page#{' current' if page.current?}"} + = link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml new file mode 100644 index 00000000..858fe9c5 --- /dev/null +++ b/app/views/kaminari/gitlab/_paginator.html.haml @@ -0,0 +1,18 @@ +-# The container tag +-# available local variables +-# current_page: a page object for the currently displayed page +-# num_pages: total number of pages +-# per_page: number of items to fetch per page +-# remote: data-remote +-# paginator: the paginator that renders the pagination tags inside += paginator.render do + %nav.gitlab_pagination + -#= first_page_tag unless current_page.first? + = prev_page_tag + - each_page do |page| + - if page.left_outer? || page.right_outer? || page.inside_window? + = page_tag page + - elsif !page.was_truncated? + = gap_tag + = next_page_tag + -#= last_page_tag unless current_page.last? diff --git a/app/views/kaminari/gitlab/_prev_page.html.haml b/app/views/kaminari/gitlab/_prev_page.html.haml new file mode 100644 index 00000000..13f0d8ad --- /dev/null +++ b/app/views/kaminari/gitlab/_prev_page.html.haml @@ -0,0 +1,9 @@ +-# Link to the "Previous" page +-# available local variables +-# url: url to the previous page +-# current_page: a page object for the currently displayed page +-# num_pages: total number of pages +-# per_page: number of items to fetch per page +-# remote: data-remote +%span.prev + = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote From 52d8ed9e4f716f7bf89bc544aa38a810a007f244 Mon Sep 17 00:00:00 2001 From: randx Date: Thu, 22 Mar 2012 00:09:57 +0200 Subject: [PATCH 07/15] Pagination for Merge Requests. Fixed for issues --- app/assets/stylesheets/common.scss | 15 +++++++-------- app/controllers/issues_controller.rb | 4 ++-- app/controllers/merge_requests_controller.rb | 2 +- app/views/issues/_issues.html.haml | 11 ++++++++--- app/views/kaminari/gitlab/_paginator.html.haml | 2 -- app/views/merge_requests/index.html.haml | 7 ++++++- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index a729dfe0..d6750d3a 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -476,8 +476,7 @@ img.lil_av { } } - &.bottom { - padding: 0 10px; + .bottom { background:#f5f5f5; border-top: 1px solid #eee; @include round-borders-bottom(4px); @@ -1029,11 +1028,11 @@ p.time { } .gitlab_pagination { - span { - padding:0 10px; - - a { - color:$link_color; - } + span a { color:$link_color; } + .prev, .next, .current, .page a { + padding:10px; + } + .current { + border-bottom:2px solid $style_color; } } diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 1fc59d98..4070f899 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -28,9 +28,9 @@ class IssuesController < ApplicationController when 2 then @project.issues.closed when 3 then @project.issues.opened.assigned(current_user) else @project.issues.opened - end.page(params[:page]).per(10) + end.page(params[:page]).per(20) - @issues = @issues.includes(:author, :project) + @issues = @issues.includes(:author, :project).order("critical, updated_at") respond_to do |format| format.html # index.html.erb diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index 3a3143cb..f882028f 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -28,7 +28,7 @@ class MergeRequestsController < ApplicationController when 2 then @merge_requests.closed when 3 then @merge_requests.opened.assigned(current_user) else @merge_requests.opened - end + end.page(params[:page]).per(20) @merge_requests = @merge_requests.includes(:author, :project).order("created_at desc") end diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index f18cbe20..f82aee94 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,7 +1,12 @@ -- @issues.critical.each do |issue| +- @issues.select(&:critical).each do |issue| = render(:partial => 'issues/show', :locals => {:issue => issue}) -- @issues.non_critical.each do |issue| +- @issues.reject(&:critical).each do |issue| = render(:partial => 'issues/show', :locals => {:issue => issue}) -%li= paginate @issues, :remote => true, :theme => "gitlab" +- if @issues.present? + %li.bottom + .row + .span10= paginate @issues, :remote => true, :theme => "gitlab" + .span4.right + %span.cgray.right #{@issues.total_count} issues for this filter diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml index 858fe9c5..6dd5a578 100644 --- a/app/views/kaminari/gitlab/_paginator.html.haml +++ b/app/views/kaminari/gitlab/_paginator.html.haml @@ -7,7 +7,6 @@ -# paginator: the paginator that renders the pagination tags inside = paginator.render do %nav.gitlab_pagination - -#= first_page_tag unless current_page.first? = prev_page_tag - each_page do |page| - if page.left_outer? || page.right_outer? || page.inside_window? @@ -15,4 +14,3 @@ - elsif !page.was_truncated? = gap_tag = next_page_tag - -#= last_page_tag unless current_page.last? diff --git a/app/views/merge_requests/index.html.haml b/app/views/merge_requests/index.html.haml index 468eaf33..9a03d195 100644 --- a/app/views/merge_requests/index.html.haml +++ b/app/views/merge_requests/index.html.haml @@ -27,5 +27,10 @@ - if @merge_requests.blank? %li %p.padded Nothing to show here - + - if @merge_requests.present? + %li.bottom + .row + .span10= paginate @merge_requests, :theme => "gitlab" + .span4.right + %span.cgray.right #{@merge_requests.total_count} merge requests for this filter From e6153beda8527c7246565ff7deae93c766d6d2cb Mon Sep 17 00:00:00 2001 From: Olexandr Skrypnyk Date: Thu, 22 Mar 2012 15:34:16 +0200 Subject: [PATCH 08/15] replace if statement with try_files in nginx.conf http://wiki.nginx.org/IfIsEvil --- doc/installation.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/doc/installation.md b/doc/installation.md index 823bd483..615efd27 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -220,15 +220,11 @@ Edit /etc/nginx/nginx.conf. Add next code to **http** section: server { listen 80; server_name mygitlab.com; - - location / { - - root /home/gitlab/gitlab/public; - - if (!-f $request_filename) { - proxy_pass http://gitlab; - break; - } + root /home/gitlab/gitlab/public; + try_files $uri $uri/index.html $uri.html @gitlab; + + location @gitlab { + proxy_pass http://gitlab; } } From e241d1e6700f88ecd5aef481596fa1cc782841f0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 22 Mar 2012 20:02:38 +0200 Subject: [PATCH 09/15] Fix form label for ssl requests --- app/helpers/application_helper.rb | 8 ++++++++ app/views/admin/projects/_form.html.haml | 2 +- app/views/projects/_form.html.haml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4d85e394..a69a1a0b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -11,6 +11,14 @@ module ApplicationHelper true end + def request_protocol + request.ssl? ? "https" : "http" + end + + def web_app_url + "#{request_protocol}://#{GIT_HOST["host"]}/" + end + def body_class(default_class = nil) main = content_for(:body_class).blank? ? default_class : diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml index 8e16437e..84cd030e 100644 --- a/app/views/admin/projects/_form.html.haml +++ b/app/views/admin/projects/_form.html.haml @@ -20,7 +20,7 @@ Code .input .input-prepend - %span.add-on= "http://#{GIT_HOST["host"]}/" + %span.add-on= web_app_url = f.text_field :code, :placeholder => "example" - unless @admin_project.new_record? diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 9c39f807..5d22f11d 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -19,7 +19,7 @@ Code .input .input-prepend - %span.add-on= "http://#{GIT_HOST["host"]}/" + %span.add-on= web_app_url = f.text_field :code, :placeholder => "example" - unless @project.new_record? || @project.heads.empty? From 6f2c19320464c928e3dae0373a7af315bf5fb043 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 22 Mar 2012 20:09:47 +0200 Subject: [PATCH 10/15] Fix issues search --- app/controllers/issues_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 4070f899..7a92fcfb 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -114,7 +114,7 @@ class IssuesController < ApplicationController when 2 then @project.issues.closed when 3 then @project.issues.opened.assigned(current_user) else @project.issues.opened - end + end.page(params[:page]).per(100) @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank? From 81da8e46f24913ccf42d3e2644962cbcbc0f9c2e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 22 Mar 2012 22:28:02 +0200 Subject: [PATCH 11/15] Remove button for empty repo. Last push on dashboard. Better notes count indicator for issues --- app/assets/stylesheets/common.scss | 17 ++++++----- app/controllers/dashboard_controller.rb | 1 + app/models/event.rb | 1 + app/views/dashboard/_projects_feed.html.haml | 2 +- app/views/dashboard/index.html.haml | 31 +++++++++++++------- app/views/issues/_show.html.haml | 8 ++--- app/views/projects/empty.html.haml | 4 +++ 7 files changed, 40 insertions(+), 24 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index d6750d3a..33a1f342 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -114,9 +114,17 @@ a:focus { margin-top:10px; } +.prepend-top-20 { + margin-top:20px; +} + .padded { padding:20px; } + +.ipadded { + padding:20px !important; +} .no-borders { border:none; } @@ -861,14 +869,7 @@ p.time { border:none; &:hover { background:none; - - h4 { - color:#2FA0BB; - .arrow { - background:#2FA0BB; - color:#fff; - } - } + h4 { color:#2FA0BB; } } h4 { diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index f6b09e23..da75465e 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -13,6 +13,7 @@ class DashboardController < ApplicationController @issues = @issues.includes(:author, :project) @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20) + @last_push = Event.where(:project_id => @projects.map(&:id)).recent.code_push.limit(1).first end # Get authored or assigned open merge requests diff --git a/app/models/event.rb b/app/models/event.rb index c8af9363..adc558b6 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -15,6 +15,7 @@ class Event < ActiveRecord::Base serialize :data scope :recent, order("created_at DESC") + scope :code_push, where(:action => Pushed) def self.determine_action(record) if [Issue, MergeRequest].include? record.class diff --git a/app/views/dashboard/_projects_feed.html.haml b/app/views/dashboard/_projects_feed.html.haml index 61154147..e3f61e66 100644 --- a/app/views/dashboard/_projects_feed.html.haml +++ b/app/views/dashboard/_projects_feed.html.haml @@ -3,7 +3,7 @@ = link_to project do %h4 %span.ico.project - = project.name + = truncate project.name, :length => 30 %small last activity at = project.last_activity_date.stamp("Aug 25, 2011") diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index b20fafca..39b05d0c 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -20,17 +20,26 @@ .row .dashboard_block .row - .span10= render "dashboard/projects_feed", :projects => @active_projects - .span4.right - - if current_user.can_create_project? - .alert-message.block-message.warning - You can create up to - = current_user.projects_limit - projects. Click on link below to add a new one - .link_holder - = link_to new_project_path, :class => "" do - New Project » - + .span4 + %div.prettyprint.ipadded + %h1 + = pluralize current_user.projects.count, "project", "projects" + - if current_user.can_create_project? + %hr + %div + You can create up to + = current_user.projects_limit + projects. Click on button below to add a new one + .link_holder + %br + = link_to new_project_path, :class => "btn" do + New Project » + .span10.right= render "dashboard/projects_feed", :projects => @active_projects + - if @last_push + .ui-box.padded.prepend-top-20 + %h5 + %small Latest push was to the #{@last_push.branch_name} branch of #{@last_push.project.name}: + %ul.unstyled= render @last_push - if @merge_requests.any? %div.dashboard_category diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index 78d50340..b2cf54d1 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -1,10 +1,12 @@ %li.wll{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(issue.project, issue) } .right + - if issue.notes.any? + %span.btn.small.disabled.padded= pluralize issue.notes.count, 'note' - if can? current_user, :modify_issue, issue - if issue.closed - = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small", :remote => true + = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small padded", :remote => true - else - = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small", :remote => true + = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small padded", :remote => true = link_to 'Edit', edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true = image_tag gravatar_icon(issue.assignee_email), :class => "avatar" %span.update-author @@ -14,8 +16,6 @@ %span.label.important critical - if issue.today? %span.label.success today - - if issue.notes.any? - %span.pretty_label= pluralize issue.notes.count, 'note' - if issue.upvotes > 0 %span.label.success= "+#{issue.upvotes}" diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 3fb81370..249442c1 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -38,3 +38,7 @@ "git remote add origin #{@project.url_to_repo}", "git push -u origin master"].join("\n") = raw bash_lexer.highlight(exist_repo_setup_str) + + - if can? current_user, :admin_project, @project + .alert-message.block-message.error.prepend-top-20 + = link_to 'Remove project', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger" From fa8219e0a753e642a6f1dbdfc010d01ae8a949ee Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 22 Mar 2012 22:57:04 +0200 Subject: [PATCH 12/15] better MR list, dashboard pollished --- app/views/dashboard/index.html.haml | 8 ++++---- .../merge_requests/_merge_request.html.haml | 16 +++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 39b05d0c..289e8d0a 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -20,8 +20,8 @@ .row .dashboard_block .row - .span4 - %div.prettyprint.ipadded + .span4.right + %div.borders.ipadded %h1 = pluralize current_user.projects.count, "project", "projects" - if current_user.can_create_project? @@ -34,9 +34,9 @@ %br = link_to new_project_path, :class => "btn" do New Project » - .span10.right= render "dashboard/projects_feed", :projects => @active_projects + .span10.left= render "dashboard/projects_feed", :projects => @active_projects - if @last_push - .ui-box.padded.prepend-top-20 + .padded.prepend-top-20 %h5 %small Latest push was to the #{@last_push.branch_name} branch of #{@last_push.project.name}: %ul.unstyled= render @last_push diff --git a/app/views/merge_requests/_merge_request.html.haml b/app/views/merge_requests/_merge_request.html.haml index 9f556c06..54300fae 100644 --- a/app/views/merge_requests/_merge_request.html.haml +++ b/app/views/merge_requests/_merge_request.html.haml @@ -1,17 +1,19 @@ %li.wll + .right + .left + - if merge_request.notes.any? + %span.btn.small.disabled.padded= pluralize merge_request.notes.count, 'note' + %span.btn.small.disabled.padded + = merge_request.source_branch + → + = merge_request.target_branch = image_tag gravatar_icon(merge_request.author_email), :class => "avatar" %span.update-author %strong= merge_request.author_name authored = time_ago_in_words(merge_request.created_at) ago - - if merge_request.notes.any? - %span.pretty_label= pluralize merge_request.notes.count, 'note' - if merge_request.upvotes > 0 %span.label.success= "+#{merge_request.upvotes}" - .right - %span.label= merge_request.source_branch - → - %span.label= merge_request.target_branch = link_to project_merge_request_path(merge_request.project, merge_request) do - %p.row_title= truncate(merge_request.title, :length => 100) + %p.row_title= truncate(merge_request.title, :length => 80) From 47af1b7fe87ec933ac7e0d9ef8d873fc99a2fad7 Mon Sep 17 00:00:00 2001 From: arenard Date: Fri, 23 Mar 2012 11:18:18 +0100 Subject: [PATCH 13/15] Use of -p option of mkdir command to avoid message telling tmp/pids directory already exists at every GitLab (re)start. It ensures that all directories on the path exists so it can create tmp directory if its not there for some reason. --- resque.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resque.sh b/resque.sh index d8b68d46..f26d44a5 100755 --- a/resque.sh +++ b/resque.sh @@ -1,2 +1,2 @@ -mkdir tmp/pids +mkdir -p tmp/pids nohup bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production PIDFILE=tmp/pids/resque_worker.pid & >> log/resque_worker.log 2>&1 From 255a9e0325471aa270a65201a0b43c77823faf06 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 23 Mar 2012 23:00:05 +0200 Subject: [PATCH 14/15] Improved resque.sh --- resque.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resque.sh b/resque.sh index d8b68d46..e6b403c5 100755 --- a/resque.sh +++ b/resque.sh @@ -1,2 +1,2 @@ mkdir tmp/pids -nohup bundle exec rake environment resque:work QUEUE=* RAILS_ENV=production PIDFILE=tmp/pids/resque_worker.pid & >> log/resque_worker.log 2>&1 +bundle exec rake environment resque:work QUEUE=post_receive RAILS_ENV=production PIDFILE=tmp/pids/resque_worker.pid BACKGROUND=yes From 1c6df8e075abf87c6911be7ca9a691d48b7d4009 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 24 Mar 2012 01:01:36 +0200 Subject: [PATCH 15/15] Improved profile & team member show --- app/assets/stylesheets/common.scss | 15 ++-- app/models/user.rb | 9 +- app/views/dashboard/index.html.haml | 9 ++ app/views/devise/sessions/new.html.erb | 7 ++ app/views/devise/shared/_links.erb | 6 -- app/views/profile/show.html.haml | 83 ++++++++++++------- app/views/team_members/show.html.haml | 83 ++++++++++--------- .../20120323221339_add_bio_field_to_user.rb | 5 ++ db/schema.rb | 3 +- 9 files changed, 139 insertions(+), 81 deletions(-) create mode 100644 db/migrate/20120323221339_add_bio_field_to_user.rb diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 33a1f342..581ad507 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -358,12 +358,15 @@ img.lil_av { top: 3px; } -.media-grid { - h3, h2 , h4 { - &.media_h { - padding-left:10px; - float:left; - } +.profile_avatar_holder { + float:left; + width:90px; + height:90px; + margin-right:20px; + img { + width:90px; + height:90px; + background:#eee; } } diff --git a/app/models/user.rb b/app/models/user.rb index 5caa7451..62c84a1e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,13 +5,19 @@ class User < ActiveRecord::Base :recoverable, :rememberable, :trackable, :validatable, :omniauthable # Setup accessible (or protected) attributes for your model - attr_accessible :email, :password, :password_confirmation, :remember_me, + attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :projects_limit, :skype, :linkedin, :twitter, :dark_scheme, :theme_id has_many :users_projects, :dependent => :destroy has_many :projects, :through => :users_projects has_many :my_own_projects, :class_name => "Project", :foreign_key => :owner_id has_many :keys, :dependent => :destroy + + has_many :recent_events, + :class_name => "Event", + :foreign_key => :author_id, + :order => "id DESC" + has_many :issues, :foreign_key => :author_id, :dependent => :destroy @@ -38,6 +44,7 @@ class User < ActiveRecord::Base :presence => true, :numericality => {:greater_than_or_equal_to => 0} + validates :bio, :length => { :within => 0..255 } before_create :ensure_authentication_token alias_attribute :private_token, :authentication_token diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 289e8d0a..0199cb9d 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -34,6 +34,15 @@ %br = link_to new_project_path, :class => "btn" do New Project » + - else + %hr + %div + You've reached project limit for your account. + You cannot create new projects. + .link_holder + %br + = link_to profile_path, :class => "btn" do + Your Profile » .span10.left= render "dashboard/projects_feed", :projects => @active_projects - if @last_push .padded.prepend-top-20 diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index f40a8794..da8f9117 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -9,6 +9,13 @@
<%= f.submit "Sign in", :class => "primary btn" %>
<%= render :partial => "devise/shared/links" %>
+ + <%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> +
+ <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" %>
+ <% end -%> + <% end -%> <% if ldap_enable? -%>

<%= link_to "via LDAP", user_omniauth_authorize_path(:ldap)%>

<% end -%> diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb index c624c2d5..d7499d14 100644 --- a/app/views/devise/shared/_links.erb +++ b/app/views/devise/shared/_links.erb @@ -17,9 +17,3 @@ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
<% end -%> - -<%- if devise_mapping.omniauthable? %> - <%- resource_class.omniauth_providers.each do |provider| %> - <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
- <% end -%> -<% end -%> diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml index ab491657..293ccd91 100644 --- a/app/views/profile/show.html.haml +++ b/app/views/profile/show.html.haml @@ -1,15 +1,26 @@ -.media-grid - = link_to "#" do - = image_tag gravatar_icon(@user.email, 90), :class => "thumbnail" - %h3.media_h - = @user.name - %br - %small - = @user.email - - .right - %p.alert-message.block-message You can change your avatar at gravatar.com - +.row + .span10 + .profile_avatar_holder + = image_tag gravatar_icon(@user.email, 90), :class => "styled_image" + %h3 + = @user.name + %br + %small + = @user.email + + .span6.right + %div + %div + %h5.cgray + Personal projects: + %span.right + %span= current_user.my_own_projects.count + of + %span= current_user.projects_limit + %h5.cgray + SSH public keys: + %span.right + %span= current_user.keys.count %hr = form_for @user, :url => profile_update_path, :method => :put do |f| @@ -18,23 +29,39 @@ %ul - @user.errors.full_messages.each do |msg| %li= msg - - .clearfix - = f.label :name - .input= f.text_field :name - .clearfix - = f.label :email - .input= f.text_field :email - .clearfix - = f.label :skype - .input= f.text_field :skype - .clearfix - = f.label :linkedin - .input= f.text_field :linkedin - .clearfix - = f.label :twitter - .input= f.text_field :twitter + .row + .span9 + .clearfix + = f.label :name + .input + = f.text_field :name, :class => "xlarge" + %span.help-block Enter youre name, so people you know can recognize you. + .clearfix + = f.label :email + .input + = f.text_field :email, :class => "xlarge" + %span.help-block We also use email for avatar detection + .clearfix + = f.label :skype + .input= f.text_field :skype, :class => "xlarge" + .clearfix + = f.label :linkedin + .input= f.text_field :linkedin, :class => "xlarge" + .clearfix + = f.label :twitter + .input= f.text_field :twitter, :class => "xlarge" + .clearfix + = f.label :bio + .input + = f.text_area :bio, :rows => 6, :class => "xlarge", :maxlength => 250 + %span.help-block About yourself in fewer than 250 characters. + .span7.right + %p.alert-message.block-message + %strong Tip: + You can change your avatar at gravatar.com .actions = f.submit 'Save', :class => "primary btn" +-#= link_to "New project", new_project_path, :class => "btn small padded" +-#= link_to "New public key", new_key_path, :class => "btn small" diff --git a/app/views/team_members/show.html.haml b/app/views/team_members/show.html.haml index d05ef740..0ed755a1 100644 --- a/app/views/team_members/show.html.haml +++ b/app/views/team_members/show.html.haml @@ -1,54 +1,59 @@ - allow_admin = can? current_user, :admin_project, @project - user = @team_member.user -.media-grid - = link_to "#" do - = image_tag gravatar_icon(user.email, 60), :class => "thumbnail", :width => 60 - %h3.media_h - = user.name + +.row + .span8 + .profile_avatar_holder + = image_tag gravatar_icon(user.email, 90), :class => "styled_image" + %h3 + = user.name + %br + %small + = user.email %br - %small= user.email - -.back_link - = link_to team_project_path(@project), :class => "" do - ← To team list - -%br -%table.zebra-striped.borders - %tr - %td Name - %td= user.name + .back_link + %br + = link_to team_project_path(@project), :class => "" do + ← To team list - %tr - %td Email - %td= user.email + .span8.right + %div + %div + %h5.cgray + Member since: + %span.right + = @team_member.created_at.stamp("Aug 21, 2011") + %h5.cgray + Project Access: + %small (#{link_to "read more", help_permissions_path, :class => "vlink"}) + %span.right + = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f| + = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin - %tr - %td Member since - %td= @team_member.created_at.stamp("Aug 21, 2011") - %tr - %td - Project Access - (#{link_to "read more", help_permissions_path, :class => "vlink"}) - - %td - = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f| - = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin +%div.prepend-top-20 - unless user.skype.empty? - %tr - %td Skype: - %td= user.skype + %p + %b Skype: + = user.skype - unless user.linkedin.empty? - %tr - %td LinkedIn: - %td= user.linkedin + %p + %b LinkedIn: + = user.linkedin - unless user.twitter.empty? - %tr - %td Twitter: - %td= user.twitter + %p + %b Twitter: + = user.twitter + - unless user.bio.empty? + %p + %b Bio: + = user.bio + += render user.recent_events.limit(3) + - if can? current_user, :admin_project, @project .actions diff --git a/db/migrate/20120323221339_add_bio_field_to_user.rb b/db/migrate/20120323221339_add_bio_field_to_user.rb new file mode 100644 index 00000000..80a4dec5 --- /dev/null +++ b/db/migrate/20120323221339_add_bio_field_to_user.rb @@ -0,0 +1,5 @@ +class AddBioFieldToUser < ActiveRecord::Migration + def change + add_column :users, :bio, :string, :null => true + end +end diff --git a/db/schema.rb b/db/schema.rb index e224aa2c..c76fd9b5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20120315132931) do +ActiveRecord::Schema.define(:version => 20120323221339) do create_table "events", :force => true do |t| t.string "target_type" @@ -155,6 +155,7 @@ ActiveRecord::Schema.define(:version => 20120315132931) do t.string "authentication_token" t.boolean "dark_scheme", :default => false, :null => false t.integer "theme_id", :default => 1, :null => false + t.string "bio" end add_index "users", ["email"], :name => "index_users_on_email", :unique => true