From 9f45e01e8426b9d678a210bb5237628676f99894 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Thu, 7 Feb 2013 14:42:52 +0400 Subject: [PATCH 01/10] Description to groups added --- app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/sections/groups.scss | 31 +++++++++++++++++++ app/models/group.rb | 15 ++++----- app/models/namespace.rb | 5 +-- app/views/admin/groups/edit.html.haml | 9 ++++-- app/views/admin/groups/index.html.haml | 4 ++- app/views/admin/groups/new.html.haml | 10 ++++-- app/views/admin/groups/show.html.haml | 8 ++++- app/views/dashboard/_groups.html.haml | 10 +++--- ...206084024_add_description_to_namsespace.rb | 5 +++ db/schema.rb | 7 +++-- 11 files changed, 83 insertions(+), 22 deletions(-) create mode 100644 app/assets/stylesheets/sections/groups.scss create mode 100644 db/migrate/20130206084024_add_description_to_namsespace.rb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 6b500b88..8afda88a 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -20,6 +20,7 @@ @import "sections/nav.scss"; @import "sections/commits.scss"; @import "sections/issues.scss"; +@import "sections/groups.scss"; @import "sections/projects.scss"; @import "sections/snippets.scss"; @import "sections/votes.scss"; diff --git a/app/assets/stylesheets/sections/groups.scss b/app/assets/stylesheets/sections/groups.scss new file mode 100644 index 00000000..9f5dc15a --- /dev/null +++ b/app/assets/stylesheets/sections/groups.scss @@ -0,0 +1,31 @@ +.projects { + @extend .row; + .activities { + } + + .side { + @extend .right; + + .groups_box { + > .title { + padding: 2px 15px; + } + .well-list { + li { padding: 15px; } + .edit { + float: right; + margin: 0; + } + .description { + padding-top: 5px; + display: block; + span, strong { + font-size: 12px; + color: #666; + } + } + } + @extend .ui-box; + } + } +} diff --git a/app/models/group.rb b/app/models/group.rb index 8ba92980..7651ce23 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -2,13 +2,14 @@ # # Table name: namespaces # -# id :integer not null, primary key -# name :string(255) not null -# path :string(255) not null -# owner_id :integer not null -# created_at :datetime not null -# updated_at :datetime not null -# type :string(255) +# id :integer not null, primary key +# name :string(255) not null +# description :string(255) not null +# path :string(255) not null +# owner_id :integer not null +# created_at :datetime not null +# updated_at :datetime not null +# type :string(255) # class Group < Namespace diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 385fa291..992ead4f 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -4,6 +4,7 @@ # # id :integer not null, primary key # name :string(255) not null +# description :string(255) not null # path :string(255) not null # owner_id :integer not null # created_at :datetime not null @@ -12,7 +13,7 @@ # class Namespace < ActiveRecord::Base - attr_accessible :name, :path + attr_accessible :name, :description, :path has_many :projects, dependent: :destroy belongs_to :owner, class_name: "User" @@ -22,7 +23,7 @@ class Namespace < ActiveRecord::Base length: { within: 0..255 }, format: { with: Gitlab::Regex.name_regex, message: "only letters, digits, spaces & '_' '-' '.' allowed." } - + validates :description, length: { within: 0..255 } validates :path, uniqueness: true, presence: true, length: { within: 1..255 }, format: { with: Gitlab::Regex.path_regex, message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml index dce04495..f34ed83f 100644 --- a/app/views/admin/groups/edit.html.haml +++ b/app/views/admin/groups/edit.html.haml @@ -1,4 +1,4 @@ -%h3.page_title Rename Group +%h3.page_title Edit Group %hr = form_for [:admin, @group] do |f| - if @group.errors.any? @@ -10,7 +10,10 @@ .input = f.text_field :name, placeholder: "Example Group", class: "xxlarge" - + .clearfix.group_description_holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 .clearfix.group_name_holder = f.label :path do @@ -24,5 +27,5 @@ %li It will change the git path to repositories under this group. .form-actions - = f.submit 'Rename group', class: "btn btn-remove" + = f.submit 'Edit group', class: "btn btn-remove" = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel" diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index 6d5a293e..1b4ffcb6 100644 --- a/app/views/admin/groups/index.html.haml +++ b/app/views/admin/groups/index.html.haml @@ -17,6 +17,7 @@ Name %i.icon-sort-down %th Path + %th Description %th Projects %th Owner %th.cred Danger Zone! @@ -25,11 +26,12 @@ %tr %td %strong= link_to group.name, [:admin, group] + %td= group.description %td= group.path %td= group.projects.count %td = link_to group.owner_name, admin_user_path(group.owner) %td.bgred - = link_to 'Rename', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small" + = link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small" = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" = paginate @groups, theme: "admin" diff --git a/app/views/admin/groups/new.html.haml b/app/views/admin/groups/new.html.haml index 60c6fa5a..29bbcc55 100644 --- a/app/views/admin/groups/new.html.haml +++ b/app/views/admin/groups/new.html.haml @@ -9,8 +9,14 @@ Group name is .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" -   - = f.submit 'Create group', class: "btn btn-primary" + .clearfix.group_description_holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + + .form-actions + = f.submit 'Create group', class: "btn btn-primary" + %hr .padded %ul diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index 90f8fc0f..63ea78fd 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -16,7 +16,13 @@   = link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do %i.icon-edit - Rename + Edit + %tr + %td + %b + Description: + %td + = @group.description %tr %td %b diff --git a/app/views/dashboard/_groups.html.haml b/app/views/dashboard/_groups.html.haml index ba8d3029..8c1dfc12 100644 --- a/app/views/dashboard/_groups.html.haml +++ b/app/views/dashboard/_groups.html.haml @@ -1,4 +1,4 @@ -.ui-box +.groups_box %h5.title Groups %small @@ -13,6 +13,8 @@ %li = link_to group_path(id: group.path), class: dom_class(group) do %strong.well-title= truncate(group.name, length: 35) - %span.pull-right.light - - if group.owner == current_user - %i.icon-wrench + %span.edit.light + - if group.owner == current_user + %i.icon-wrench + %span.description + %strong= group.description diff --git a/db/migrate/20130206084024_add_description_to_namsespace.rb b/db/migrate/20130206084024_add_description_to_namsespace.rb new file mode 100644 index 00000000..ef02e489 --- /dev/null +++ b/db/migrate/20130206084024_add_description_to_namsespace.rb @@ -0,0 +1,5 @@ +class AddDescriptionToNamsespace < ActiveRecord::Migration + def change + add_column :namespaces, :description, :string, default: '', null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 74d5f9a3..63f498e4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -112,6 +112,7 @@ ActiveRecord::Schema.define(:version => 20130220133245) do t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.string "type" + t.string "description", :default => "", :null => false end add_index "namespaces", ["name"], :name => "index_namespaces_on_name" @@ -152,6 +153,8 @@ ActiveRecord::Schema.define(:version => 20130220133245) do t.boolean "wiki_enabled", :default => true, :null => false t.integer "namespace_id" t.boolean "public", :default => false, :null => false + t.string "issues_tracker", :default => "gitlab", :null => false + t.string "issues_tracker_id" end add_index "projects", ["creator_id"], :name => "index_projects_on_owner_id" @@ -230,8 +233,8 @@ ActiveRecord::Schema.define(:version => 20130220133245) do t.string "name" t.string "path" t.integer "owner_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "users", :force => true do |t| From 5f657203a1c19b3eca38b3961dfe24e3a06af910 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Thu, 7 Feb 2013 15:10:14 +0400 Subject: [PATCH 02/10] Description added to temas --- app/assets/stylesheets/application.scss | 1 + app/assets/stylesheets/sections/teams.scss | 31 +++++++++++++++++++ app/models/user_team.rb | 3 +- app/views/admin/teams/edit.html.haml | 9 ++++-- app/views/admin/teams/index.html.haml | 4 ++- app/views/admin/teams/new.html.haml | 11 +++++-- app/views/admin/teams/show.html.haml | 8 ++++- app/views/dashboard/_teams.html.haml | 16 +++++----- ...20130207104426_add_description_to_teams.rb | 5 +++ 9 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 app/assets/stylesheets/sections/teams.scss create mode 100644 db/migrate/20130207104426_add_description_to_teams.rb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 8afda88a..25cef432 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -21,6 +21,7 @@ @import "sections/commits.scss"; @import "sections/issues.scss"; @import "sections/groups.scss"; +@import "sections/teams.scss"; @import "sections/projects.scss"; @import "sections/snippets.scss"; @import "sections/votes.scss"; diff --git a/app/assets/stylesheets/sections/teams.scss b/app/assets/stylesheets/sections/teams.scss new file mode 100644 index 00000000..b5c546ca --- /dev/null +++ b/app/assets/stylesheets/sections/teams.scss @@ -0,0 +1,31 @@ +.projects { + @extend .row; + .activities { + } + + .side { + @extend .right; + + .teams_box { + > .title { + padding: 2px 15px; + } + .well-list { + li { padding: 15px; } + .edit { + float: right; + margin: 0; + } + .description { + padding-top: 5px; + display: block; + span, strong { + font-size: 12px; + color: #666; + } + } + } + @extend .ui-box; + } + } +} diff --git a/app/models/user_team.rb b/app/models/user_team.rb index 2f3091c2..0cb84edd 100644 --- a/app/models/user_team.rb +++ b/app/models/user_team.rb @@ -11,7 +11,7 @@ # class UserTeam < ActiveRecord::Base - attr_accessible :name, :owner_id, :path + attr_accessible :name, :description, :owner_id, :path belongs_to :owner, class_name: User @@ -26,6 +26,7 @@ class UserTeam < ActiveRecord::Base length: { within: 0..255 }, format: { with: Gitlab::Regex.name_regex, message: "only letters, digits, spaces & '_' '-' '.' allowed." } + validates :description, length: { within: 0..255 } validates :path, uniqueness: true, presence: true, length: { within: 1..255 }, format: { with: Gitlab::Regex.path_regex, message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" } diff --git a/app/views/admin/teams/edit.html.haml b/app/views/admin/teams/edit.html.haml index 9282398c..a48a369b 100644 --- a/app/views/admin/teams/edit.html.haml +++ b/app/views/admin/teams/edit.html.haml @@ -1,4 +1,4 @@ -%h3.page_title Rename Team +%h3.page_title Edit Team %hr = form_for @team, url: admin_team_path(@team), method: :put do |f| - if @team.errors.any? @@ -10,6 +10,11 @@ .input = f.text_field :name, placeholder: "Example Team", class: "xxlarge" + .clearfix.team_description_holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + .clearfix.team_name_holder = f.label :path do %span.cred Team path is @@ -19,5 +24,5 @@ %li It will change web url for access team and team projects. .form-actions - = f.submit 'Rename team', class: "btn btn-remove" + = f.submit 'Edit team', class: "btn btn-remove" = link_to 'Cancel', admin_teams_path, class: "btn btn-cancel" diff --git a/app/views/admin/teams/index.html.haml b/app/views/admin/teams/index.html.haml index bb0487d4..62af4b50 100644 --- a/app/views/admin/teams/index.html.haml +++ b/app/views/admin/teams/index.html.haml @@ -16,6 +16,7 @@ %th Name %i.icon-sort-down + %th Description %th Path %th Projects %th Members @@ -26,13 +27,14 @@ %tr %td %strong= link_to team.name, admin_team_path(team) + %td= team.description %td= team.path %td= team.projects.count %td= team.members.count %td = link_to team.owner.name, admin_user_path(team.owner) %td.bgred - = link_to 'Rename', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small" + = link_to 'Edit', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small" = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" = paginate @teams, theme: "admin" diff --git a/app/views/admin/teams/new.html.haml b/app/views/admin/teams/new.html.haml index 5d55a797..a852b4cb 100644 --- a/app/views/admin/teams/new.html.haml +++ b/app/views/admin/teams/new.html.haml @@ -9,8 +9,15 @@ Team name is .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" -   - = f.submit 'Create team', class: "btn btn-primary" + + .clearfix.team_description_holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + + .form-actions + = f.submit 'Create team', class: "btn btn-primary" + %hr .padded %ul diff --git a/app/views/admin/teams/show.html.haml b/app/views/admin/teams/show.html.haml index e5d07998..abdfada8 100644 --- a/app/views/admin/teams/show.html.haml +++ b/app/views/admin/teams/show.html.haml @@ -16,7 +16,13 @@   = link_to edit_admin_team_path(@team), class: "btn btn-small pull-right" do %i.icon-edit - Rename + Edit + %tr + %td + %b + Description: + %td + = @team.description %tr %td %b diff --git a/app/views/dashboard/_teams.html.haml b/app/views/dashboard/_teams.html.haml index f5611585..76e9785e 100644 --- a/app/views/dashboard/_teams.html.haml +++ b/app/views/dashboard/_teams.html.haml @@ -1,4 +1,4 @@ -.ui-box.teams-box +.ui-box.teams_box %h5.title Teams %small @@ -12,9 +12,11 @@ %li = link_to team_path(id: team.path), class: dom_class(team) do %strong.well-title= truncate(team.name, length: 35) - %span.pull-right.light - - if team.owner == current_user - %i.icon-wrench - - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id) - - if tm - = tm.access_human + %span.edit.light + - if team.owner == current_user + %i.icon-wrench + - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id) + - if tm + = tm.access_human + %span.description + %strong= team.description diff --git a/db/migrate/20130207104426_add_description_to_teams.rb b/db/migrate/20130207104426_add_description_to_teams.rb new file mode 100644 index 00000000..6d037779 --- /dev/null +++ b/db/migrate/20130207104426_add_description_to_teams.rb @@ -0,0 +1,5 @@ +class AddDescriptionToTeams < ActiveRecord::Migration + def change + add_column :user_teams, :description, :string, default: '', null: false + end +end From b4648c3b521f2160bd4d7f47267dfaf204456825 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Thu, 7 Feb 2013 17:11:31 +0400 Subject: [PATCH 03/10] Spinach tests fixed --- features/steps/userteams/userteams.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/steps/userteams/userteams.rb b/features/steps/userteams/userteams.rb index 1abb0f49..ef432824 100644 --- a/features/steps/userteams/userteams.rb +++ b/features/steps/userteams/userteams.rb @@ -8,7 +8,7 @@ class Userteams < Spinach::FeatureSteps end Then 'I should see dashboard page without teams info block' do - page.has_no_css?(".teams-box").must_equal true + page.has_no_css?(".teams_box").must_equal true end When 'I have teams with my membership' do @@ -17,7 +17,7 @@ class Userteams < Spinach::FeatureSteps end Then 'I should see dashboard page with teams information block' do - page.should have_css(".teams-box") + page.should have_css(".teams_box") end When 'exist user teams' do From ba5373805a1e3396434df3dc023b8b573374b5a1 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Fri, 8 Feb 2013 12:16:08 +0400 Subject: [PATCH 04/10] Description added to user temas factory --- spec/factories/user_teams.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/factories/user_teams.rb b/spec/factories/user_teams.rb index 1a9ae8e8..8d1ee11e 100644 --- a/spec/factories/user_teams.rb +++ b/spec/factories/user_teams.rb @@ -15,6 +15,7 @@ FactoryGirl.define do factory :user_team do sequence(:name) { |n| "team#{n}" } + sequence(:description) { |n| "team_description#{n}" } path { name.downcase.gsub(/\s/, '_') } owner end From 3d4e32457b66f5fa49bc35d938ec27ab24b7f15b Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Fri, 8 Feb 2013 15:42:14 +0400 Subject: [PATCH 05/10] Table description indentation fixed --- app/models/namespace.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 992ead4f..c6b3e94d 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -2,14 +2,14 @@ # # Table name: namespaces # -# id :integer not null, primary key -# name :string(255) not null +# id :integer not null, primary key +# name :string(255) not null # description :string(255) not null -# path :string(255) not null -# owner_id :integer not null -# created_at :datetime not null -# updated_at :datetime not null -# type :string(255) +# path :string(255) not null +# owner_id :integer not null +# created_at :datetime not null +# updated_at :datetime not null +# type :string(255) # class Namespace < ActiveRecord::Base From 9959669f1cb533e14e5df8d240c7560a2f258f84 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Thu, 14 Feb 2013 12:14:34 +0400 Subject: [PATCH 06/10] Desctiptions removed from dashboard --- app/assets/stylesheets/application.scss | 2 -- app/assets/stylesheets/sections/groups.scss | 31 --------------------- app/assets/stylesheets/sections/teams.scss | 31 --------------------- app/views/dashboard/_groups.html.haml | 10 +++---- app/views/dashboard/_teams.html.haml | 16 +++++------ features/steps/userteams/userteams.rb | 4 +-- 6 files changed, 13 insertions(+), 81 deletions(-) delete mode 100644 app/assets/stylesheets/sections/groups.scss delete mode 100644 app/assets/stylesheets/sections/teams.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 25cef432..6b500b88 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -20,8 +20,6 @@ @import "sections/nav.scss"; @import "sections/commits.scss"; @import "sections/issues.scss"; -@import "sections/groups.scss"; -@import "sections/teams.scss"; @import "sections/projects.scss"; @import "sections/snippets.scss"; @import "sections/votes.scss"; diff --git a/app/assets/stylesheets/sections/groups.scss b/app/assets/stylesheets/sections/groups.scss deleted file mode 100644 index 9f5dc15a..00000000 --- a/app/assets/stylesheets/sections/groups.scss +++ /dev/null @@ -1,31 +0,0 @@ -.projects { - @extend .row; - .activities { - } - - .side { - @extend .right; - - .groups_box { - > .title { - padding: 2px 15px; - } - .well-list { - li { padding: 15px; } - .edit { - float: right; - margin: 0; - } - .description { - padding-top: 5px; - display: block; - span, strong { - font-size: 12px; - color: #666; - } - } - } - @extend .ui-box; - } - } -} diff --git a/app/assets/stylesheets/sections/teams.scss b/app/assets/stylesheets/sections/teams.scss deleted file mode 100644 index b5c546ca..00000000 --- a/app/assets/stylesheets/sections/teams.scss +++ /dev/null @@ -1,31 +0,0 @@ -.projects { - @extend .row; - .activities { - } - - .side { - @extend .right; - - .teams_box { - > .title { - padding: 2px 15px; - } - .well-list { - li { padding: 15px; } - .edit { - float: right; - margin: 0; - } - .description { - padding-top: 5px; - display: block; - span, strong { - font-size: 12px; - color: #666; - } - } - } - @extend .ui-box; - } - } -} diff --git a/app/views/dashboard/_groups.html.haml b/app/views/dashboard/_groups.html.haml index 8c1dfc12..ba8d3029 100644 --- a/app/views/dashboard/_groups.html.haml +++ b/app/views/dashboard/_groups.html.haml @@ -1,4 +1,4 @@ -.groups_box +.ui-box %h5.title Groups %small @@ -13,8 +13,6 @@ %li = link_to group_path(id: group.path), class: dom_class(group) do %strong.well-title= truncate(group.name, length: 35) - %span.edit.light - - if group.owner == current_user - %i.icon-wrench - %span.description - %strong= group.description + %span.pull-right.light + - if group.owner == current_user + %i.icon-wrench diff --git a/app/views/dashboard/_teams.html.haml b/app/views/dashboard/_teams.html.haml index 76e9785e..f5611585 100644 --- a/app/views/dashboard/_teams.html.haml +++ b/app/views/dashboard/_teams.html.haml @@ -1,4 +1,4 @@ -.ui-box.teams_box +.ui-box.teams-box %h5.title Teams %small @@ -12,11 +12,9 @@ %li = link_to team_path(id: team.path), class: dom_class(team) do %strong.well-title= truncate(team.name, length: 35) - %span.edit.light - - if team.owner == current_user - %i.icon-wrench - - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id) - - if tm - = tm.access_human - %span.description - %strong= team.description + %span.pull-right.light + - if team.owner == current_user + %i.icon-wrench + - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id) + - if tm + = tm.access_human diff --git a/features/steps/userteams/userteams.rb b/features/steps/userteams/userteams.rb index ef432824..1abb0f49 100644 --- a/features/steps/userteams/userteams.rb +++ b/features/steps/userteams/userteams.rb @@ -8,7 +8,7 @@ class Userteams < Spinach::FeatureSteps end Then 'I should see dashboard page without teams info block' do - page.has_no_css?(".teams_box").must_equal true + page.has_no_css?(".teams-box").must_equal true end When 'I have teams with my membership' do @@ -17,7 +17,7 @@ class Userteams < Spinach::FeatureSteps end Then 'I should see dashboard page with teams information block' do - page.should have_css(".teams_box") + page.should have_css(".teams-box") end When 'exist user teams' do From cf6d9a222213e37c9490bd30ae3a9971ac1baff5 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Tue, 19 Feb 2013 23:01:57 +0400 Subject: [PATCH 07/10] Tests for team and group descriptions added --- features/steps/admin/admin_groups.rb | 2 ++ features/steps/admin/admin_teams.rb | 2 ++ features/steps/group/group.rb | 2 ++ features/steps/userteams/userteams.rb | 7 +++++++ features/teams/team.feature | 1 + 5 files changed, 14 insertions(+) diff --git a/features/steps/admin/admin_groups.rb b/features/steps/admin/admin_groups.rb index cbca2daa..167763b6 100644 --- a/features/steps/admin/admin_groups.rb +++ b/features/steps/admin/admin_groups.rb @@ -25,11 +25,13 @@ class AdminGroups < Spinach::FeatureSteps And 'submit form with new group info' do fill_in 'group_name', :with => 'gitlab' + fill_in 'group_description', :with => 'Group description' click_button "Create group" end Then 'I should see newly created group' do page.should have_content "Group: gitlab" + page.should have_content "Group description" end Then 'I should be redirected to group page' do diff --git a/features/steps/admin/admin_teams.rb b/features/steps/admin/admin_teams.rb index 637fc4e5..6423f3df 100644 --- a/features/steps/admin/admin_teams.rb +++ b/features/steps/admin/admin_teams.rb @@ -18,6 +18,7 @@ class AdminTeams < Spinach::FeatureSteps And 'submit form with new team info' do fill_in 'user_team_name', with: 'gitlab' + fill_in 'user_team_description', with: 'description' click_button 'Create team' end @@ -27,6 +28,7 @@ class AdminTeams < Spinach::FeatureSteps And 'I should see newly created team' do page.should have_content "Team: gitlab" + page.should have_content "description" end When 'I visit admin teams page' do diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index 5cfa4756..3438ad8d 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -70,11 +70,13 @@ class Groups < Spinach::FeatureSteps And 'submit form with new group info' do fill_in 'group_name', :with => 'Samurai' + fill_in 'group_description', :with => 'Tokugawa Shogunate' click_button "Create group" end Then 'I should see newly created group' do page.should have_content "Samurai" + page.should have_content "Tokugawa Shogunate" page.should have_content "You will only see events from projects in this group" end diff --git a/features/steps/userteams/userteams.rb b/features/steps/userteams/userteams.rb index 1abb0f49..862259dc 100644 --- a/features/steps/userteams/userteams.rb +++ b/features/steps/userteams/userteams.rb @@ -44,9 +44,16 @@ class Userteams < Spinach::FeatureSteps And 'I submit form with new team info' do fill_in 'name', with: 'gitlab' + + fill_in 'user_team_description', with: 'team description' click_button 'Create team' end + And 'I should see newly created team' do + page.should have_content "gitlab" + page.should have_content "team description" + end + Then 'I should be redirected to new team page' do team = UserTeam.last current_path.should == team_path(team) diff --git a/features/teams/team.feature b/features/teams/team.feature index 9255e0da..f7774597 100644 --- a/features/teams/team.feature +++ b/features/teams/team.feature @@ -20,6 +20,7 @@ Feature: UserTeams When I click to "New team" link And I submit form with new team info Then I should be redirected to new team page + Then I should see newly created team Scenario: I should see team dashboard list When I have teams with projects and members From 9c747fbb95ed795b7159db79cea76ab8e4bd3da0 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Tue, 19 Feb 2013 23:02:25 +0400 Subject: [PATCH 08/10] Missing descriptions added --- app/views/admin/teams/edit.html.haml | 2 +- app/views/admin/teams/new.html.haml | 2 +- app/views/groups/edit.html.haml | 11 +++++++++-- app/views/groups/new.html.haml | 12 ++++++++++-- app/views/groups/show.html.haml | 5 +++++ app/views/teams/edit.html.haml | 10 ++++++++-- app/views/teams/new.html.haml | 11 +++++++++-- app/views/teams/show.html.haml | 5 +++++ 8 files changed, 48 insertions(+), 10 deletions(-) diff --git a/app/views/admin/teams/edit.html.haml b/app/views/admin/teams/edit.html.haml index a48a369b..0a3d993b 100644 --- a/app/views/admin/teams/edit.html.haml +++ b/app/views/admin/teams/edit.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Example Team", class: "xxlarge" - .clearfix.team_description_holder + .clearfix.team-description-holder = f.label :description, "Details" .input = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 diff --git a/app/views/admin/teams/new.html.haml b/app/views/admin/teams/new.html.haml index a852b4cb..1c90cb20 100644 --- a/app/views/admin/teams/new.html.haml +++ b/app/views/admin/teams/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - .clearfix.team_description_holder + .clearfix.team-description-holder = f.label :description, "Details" .input = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index 41ebf606..828a9b43 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -9,8 +9,15 @@ Group name is .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" -   - = f.submit 'Save group', class: "btn btn-save" + + .clearfix.group_description_holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + + .form-actions + = f.submit 'Save group', class: "btn btn-save" + %hr diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 73be474e..9308e9a6 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -9,8 +9,16 @@ Group name is .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" -   - = f.submit 'Create group', class: "btn btn-create" + + .clearfix.group_description_holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + + .form-actions + = f.submit 'Create group', class: "btn btn-primary" + + %hr .padded %ul diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index a140b401..fe08e0b5 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -1,3 +1,8 @@ +- if @group.description.present? + .description + = @group.description + %hr + .projects .activities.span8 = render "events/event_last_push", event: @last_push diff --git a/app/views/teams/edit.html.haml b/app/views/teams/edit.html.haml index 751fe94c..5491993d 100644 --- a/app/views/teams/edit.html.haml +++ b/app/views/teams/edit.html.haml @@ -12,13 +12,20 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xlarge left" + .clearfix.team-description-holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + .clearfix = f.label :path do Team path is .input = f.text_field :path, placeholder: "opensource", class: "xlarge left" + .form-actions - = f.submit 'Save team changes', class: "btn btn-save" + = f.submit 'Save team changes', class: "btn btn-primary" + = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn btn-remove pull-right" .span5 .ui-box %h5.title Remove team @@ -26,4 +33,3 @@ %p Removed team can not be restored! = link_to 'Remove team', team_path(@team), method: :delete, confirm: "You are sure?", class: "btn btn-remove btn-small" - diff --git a/app/views/teams/new.html.haml b/app/views/teams/new.html.haml index 7089f791..332a6a55 100644 --- a/app/views/teams/new.html.haml +++ b/app/views/teams/new.html.haml @@ -9,8 +9,15 @@ Team name is .input = f.text_field :name, placeholder: "Ex. Ruby Developers", class: "xxlarge left" -   - = f.submit 'Create team', class: "btn btn-create" + + .clearfix.team-description-holder + = f.label :description, "Details" + .input + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + + .form-actions + = f.submit 'Create team', class: "btn btn-create" + %hr .padded %ul diff --git a/app/views/teams/show.html.haml b/app/views/teams/show.html.haml index d6e80e2a..eef13cbe 100644 --- a/app/views/teams/show.html.haml +++ b/app/views/teams/show.html.haml @@ -1,3 +1,8 @@ +- if @group.description.present? + .description + = @group.description + %hr + .projects .activities.span8 = link_to dashboard_path, class: 'btn btn-tiny' do From d3f042a6f2bab3553dd4202637dfb916d8243cd6 Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Thu, 28 Feb 2013 18:35:27 +0400 Subject: [PATCH 09/10] Css classes improved --- app/views/admin/groups/edit.html.haml | 2 +- app/views/admin/groups/new.html.haml | 2 +- app/views/groups/edit.html.haml | 2 +- app/views/groups/new.html.haml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml index f34ed83f..bb1398f6 100644 --- a/app/views/admin/groups/edit.html.haml +++ b/app/views/admin/groups/edit.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Example Group", class: "xxlarge" - .clearfix.group_description_holder + .clearfix.group-description-holder = f.label :description, "Details" .input = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 diff --git a/app/views/admin/groups/new.html.haml b/app/views/admin/groups/new.html.haml index 29bbcc55..3fa63e1b 100644 --- a/app/views/admin/groups/new.html.haml +++ b/app/views/admin/groups/new.html.haml @@ -9,7 +9,7 @@ Group name is .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - .clearfix.group_description_holder + .clearfix.group-description-holder = f.label :description, "Details" .input = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index 828a9b43..bf16b70c 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - .clearfix.group_description_holder + .clearfix.group-description-holder = f.label :description, "Details" .input = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 9308e9a6..2104db86 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - .clearfix.group_description_holder + .clearfix.group-description-holder = f.label :description, "Details" .input = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 From 2f1f05d431d1df062e46365930b98b358554a07d Mon Sep 17 00:00:00 2001 From: Andrew8xx8 Date: Thu, 28 Feb 2013 18:55:35 +0400 Subject: [PATCH 10/10] Fixed notes from randx --- app/views/teams/show.html.haml | 4 ++-- db/schema.rb | 21 ++++++++++----------- features/steps/group/group.rb | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/views/teams/show.html.haml b/app/views/teams/show.html.haml index eef13cbe..34be7692 100644 --- a/app/views/teams/show.html.haml +++ b/app/views/teams/show.html.haml @@ -1,6 +1,6 @@ -- if @group.description.present? +- if @team.description.present? .description - = @group.description + = @team.description %hr .projects diff --git a/db/schema.rb b/db/schema.rb index 63f498e4..e0ad8294 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -143,18 +143,16 @@ ActiveRecord::Schema.define(:version => 20130220133245) do t.string "name" t.string "path" t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "creator_id" t.string "default_branch" - t.boolean "issues_enabled", :default => true, :null => false - t.boolean "wall_enabled", :default => true, :null => false - t.boolean "merge_requests_enabled", :default => true, :null => false - t.boolean "wiki_enabled", :default => true, :null => false + t.boolean "issues_enabled", :default => true, :null => false + t.boolean "wall_enabled", :default => true, :null => false + t.boolean "merge_requests_enabled", :default => true, :null => false + t.boolean "wiki_enabled", :default => true, :null => false t.integer "namespace_id" - t.boolean "public", :default => false, :null => false - t.string "issues_tracker", :default => "gitlab", :null => false - t.string "issues_tracker_id" + t.boolean "public", :default => false, :null => false end add_index "projects", ["creator_id"], :name => "index_projects_on_owner_id" @@ -233,8 +231,9 @@ ActiveRecord::Schema.define(:version => 20130220133245) do t.string "name" t.string "path" t.integer "owner_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "description", :default => "", :null => false end create_table "users", :force => true do |t| diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb index 3438ad8d..75db9fef 100644 --- a/features/steps/group/group.rb +++ b/features/steps/group/group.rb @@ -69,8 +69,8 @@ class Groups < Spinach::FeatureSteps end And 'submit form with new group info' do - fill_in 'group_name', :with => 'Samurai' - fill_in 'group_description', :with => 'Tokugawa Shogunate' + fill_in 'group_name', with: 'Samurai' + fill_in 'group_description', with: 'Tokugawa Shogunate' click_button "Create group" end