Commit 9f45e01e8426b9d678a210bb5237628676f99894

Authored by Andrew8xx8
1 parent 135418dc

Description to groups added

app/assets/stylesheets/application.scss
... ... @@ -20,6 +20,7 @@
20 20 @import "sections/nav.scss";
21 21 @import "sections/commits.scss";
22 22 @import "sections/issues.scss";
  23 +@import "sections/groups.scss";
23 24 @import "sections/projects.scss";
24 25 @import "sections/snippets.scss";
25 26 @import "sections/votes.scss";
... ...
app/assets/stylesheets/sections/groups.scss 0 → 100644
... ... @@ -0,0 +1,31 @@
  1 +.projects {
  2 + @extend .row;
  3 + .activities {
  4 + }
  5 +
  6 + .side {
  7 + @extend .right;
  8 +
  9 + .groups_box {
  10 + > .title {
  11 + padding: 2px 15px;
  12 + }
  13 + .well-list {
  14 + li { padding: 15px; }
  15 + .edit {
  16 + float: right;
  17 + margin: 0;
  18 + }
  19 + .description {
  20 + padding-top: 5px;
  21 + display: block;
  22 + span, strong {
  23 + font-size: 12px;
  24 + color: #666;
  25 + }
  26 + }
  27 + }
  28 + @extend .ui-box;
  29 + }
  30 + }
  31 +}
... ...
app/models/group.rb
... ... @@ -2,13 +2,14 @@
2 2 #
3 3 # Table name: namespaces
4 4 #
5   -# id :integer not null, primary key
6   -# name :string(255) not null
7   -# path :string(255) not null
8   -# owner_id :integer not null
9   -# created_at :datetime not null
10   -# updated_at :datetime not null
11   -# type :string(255)
  5 +# id :integer not null, primary key
  6 +# name :string(255) not null
  7 +# description :string(255) not null
  8 +# path :string(255) not null
  9 +# owner_id :integer not null
  10 +# created_at :datetime not null
  11 +# updated_at :datetime not null
  12 +# type :string(255)
12 13 #
13 14  
14 15 class Group < Namespace
... ...
app/models/namespace.rb
... ... @@ -4,6 +4,7 @@
4 4 #
5 5 # id :integer not null, primary key
6 6 # name :string(255) not null
  7 +# description :string(255) not null
7 8 # path :string(255) not null
8 9 # owner_id :integer not null
9 10 # created_at :datetime not null
... ... @@ -12,7 +13,7 @@
12 13 #
13 14  
14 15 class Namespace < ActiveRecord::Base
15   - attr_accessible :name, :path
  16 + attr_accessible :name, :description, :path
16 17  
17 18 has_many :projects, dependent: :destroy
18 19 belongs_to :owner, class_name: "User"
... ... @@ -22,7 +23,7 @@ class Namespace &lt; ActiveRecord::Base
22 23 length: { within: 0..255 },
23 24 format: { with: Gitlab::Regex.name_regex,
24 25 message: "only letters, digits, spaces & '_' '-' '.' allowed." }
25   -
  26 + validates :description, length: { within: 0..255 }
26 27 validates :path, uniqueness: true, presence: true, length: { within: 1..255 },
27 28 format: { with: Gitlab::Regex.path_regex,
28 29 message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
... ...
app/views/admin/groups/edit.html.haml
1   -%h3.page_title Rename Group
  1 +%h3.page_title Edit Group
2 2 %hr
3 3 = form_for [:admin, @group] do |f|
4 4 - if @group.errors.any?
... ... @@ -10,7 +10,10 @@
10 10 .input
11 11 = f.text_field :name, placeholder: "Example Group", class: "xxlarge"
12 12  
13   -
  13 + .clearfix.group_description_holder
  14 + = f.label :description, "Details"
  15 + .input
  16 + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
14 17  
15 18 .clearfix.group_name_holder
16 19 = f.label :path do
... ... @@ -24,5 +27,5 @@
24 27 %li It will change the git path to repositories under this group.
25 28  
26 29 .form-actions
27   - = f.submit 'Rename group', class: "btn btn-remove"
  30 + = f.submit 'Edit group', class: "btn btn-remove"
28 31 = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel"
... ...
app/views/admin/groups/index.html.haml
... ... @@ -17,6 +17,7 @@
17 17 Name
18 18 %i.icon-sort-down
19 19 %th Path
  20 + %th Description
20 21 %th Projects
21 22 %th Owner
22 23 %th.cred Danger Zone!
... ... @@ -25,11 +26,12 @@
25 26 %tr
26 27 %td
27 28 %strong= link_to group.name, [:admin, group]
  29 + %td= group.description
28 30 %td= group.path
29 31 %td= group.projects.count
30 32 %td
31 33 = link_to group.owner_name, admin_user_path(group.owner)
32 34 %td.bgred
33   - = link_to 'Rename', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small"
  35 + = link_to 'Edit', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small"
34 36 = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
35 37 = paginate @groups, theme: "admin"
... ...
app/views/admin/groups/new.html.haml
... ... @@ -9,8 +9,14 @@
9 9 Group name is
10 10 .input
11 11 = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
12   - &nbsp;
13   - = f.submit 'Create group', class: "btn btn-primary"
  12 + .clearfix.group_description_holder
  13 + = f.label :description, "Details"
  14 + .input
  15 + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
  16 +
  17 + .form-actions
  18 + = f.submit 'Create group', class: "btn btn-primary"
  19 +
14 20 %hr
15 21 .padded
16 22 %ul
... ...
app/views/admin/groups/show.html.haml
... ... @@ -16,7 +16,13 @@
16 16 &nbsp;
17 17 = link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do
18 18 %i.icon-edit
19   - Rename
  19 + Edit
  20 + %tr
  21 + %td
  22 + %b
  23 + Description:
  24 + %td
  25 + = @group.description
20 26 %tr
21 27 %td
22 28 %b
... ...
app/views/dashboard/_groups.html.haml
1   -.ui-box
  1 +.groups_box
2 2 %h5.title
3 3 Groups
4 4 %small
... ... @@ -13,6 +13,8 @@
13 13 %li
14 14 = link_to group_path(id: group.path), class: dom_class(group) do
15 15 %strong.well-title= truncate(group.name, length: 35)
16   - %span.pull-right.light
17   - - if group.owner == current_user
18   - %i.icon-wrench
  16 + %span.edit.light
  17 + - if group.owner == current_user
  18 + %i.icon-wrench
  19 + %span.description
  20 + %strong= group.description
... ...
db/migrate/20130206084024_add_description_to_namsespace.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +class AddDescriptionToNamsespace < ActiveRecord::Migration
  2 + def change
  3 + add_column :namespaces, :description, :string, default: '', null: false
  4 + end
  5 +end
... ...
db/schema.rb
... ... @@ -112,6 +112,7 @@ ActiveRecord::Schema.define(:version =&gt; 20130220133245) do
112 112 t.datetime "created_at", :null => false
113 113 t.datetime "updated_at", :null => false
114 114 t.string "type"
  115 + t.string "description", :default => "", :null => false
115 116 end
116 117  
117 118 add_index "namespaces", ["name"], :name => "index_namespaces_on_name"
... ... @@ -152,6 +153,8 @@ ActiveRecord::Schema.define(:version =&gt; 20130220133245) do
152 153 t.boolean "wiki_enabled", :default => true, :null => false
153 154 t.integer "namespace_id"
154 155 t.boolean "public", :default => false, :null => false
  156 + t.string "issues_tracker", :default => "gitlab", :null => false
  157 + t.string "issues_tracker_id"
155 158 end
156 159  
157 160 add_index "projects", ["creator_id"], :name => "index_projects_on_owner_id"
... ... @@ -230,8 +233,8 @@ ActiveRecord::Schema.define(:version =&gt; 20130220133245) do
230 233 t.string "name"
231 234 t.string "path"
232 235 t.integer "owner_id"
233   - t.datetime "created_at", :null => false
234   - t.datetime "updated_at", :null => false
  236 + t.datetime "created_at", :null => false
  237 + t.datetime "updated_at", :null => false
235 238 end
236 239  
237 240 create_table "users", :force => true do |t|
... ...