Commit 5f657203a1c19b3eca38b3961dfe24e3a06af910

Authored by Andrew8xx8
1 parent 9f45e01e

Description added to temas

app/assets/stylesheets/application.scss
... ... @@ -21,6 +21,7 @@
21 21 @import "sections/commits.scss";
22 22 @import "sections/issues.scss";
23 23 @import "sections/groups.scss";
  24 +@import "sections/teams.scss";
24 25 @import "sections/projects.scss";
25 26 @import "sections/snippets.scss";
26 27 @import "sections/votes.scss";
... ...
app/assets/stylesheets/sections/teams.scss 0 → 100644
... ... @@ -0,0 +1,31 @@
  1 +.projects {
  2 + @extend .row;
  3 + .activities {
  4 + }
  5 +
  6 + .side {
  7 + @extend .right;
  8 +
  9 + .teams_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/user_team.rb
... ... @@ -11,7 +11,7 @@
11 11 #
12 12  
13 13 class UserTeam < ActiveRecord::Base
14   - attr_accessible :name, :owner_id, :path
  14 + attr_accessible :name, :description, :owner_id, :path
15 15  
16 16 belongs_to :owner, class_name: User
17 17  
... ... @@ -26,6 +26,7 @@ class UserTeam &lt; ActiveRecord::Base
26 26 length: { within: 0..255 },
27 27 format: { with: Gitlab::Regex.name_regex,
28 28 message: "only letters, digits, spaces & '_' '-' '.' allowed." }
  29 + validates :description, length: { within: 0..255 }
29 30 validates :path, uniqueness: true, presence: true, length: { within: 1..255 },
30 31 format: { with: Gitlab::Regex.path_regex,
31 32 message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
... ...
app/views/admin/teams/edit.html.haml
1   -%h3.page_title Rename Team
  1 +%h3.page_title Edit Team
2 2 %hr
3 3 = form_for @team, url: admin_team_path(@team), method: :put do |f|
4 4 - if @team.errors.any?
... ... @@ -10,6 +10,11 @@
10 10 .input
11 11 = f.text_field :name, placeholder: "Example Team", class: "xxlarge"
12 12  
  13 + .clearfix.team_description_holder
  14 + = f.label :description, "Details"
  15 + .input
  16 + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
  17 +
13 18 .clearfix.team_name_holder
14 19 = f.label :path do
15 20 %span.cred Team path is
... ... @@ -19,5 +24,5 @@
19 24 %li It will change web url for access team and team projects.
20 25  
21 26 .form-actions
22   - = f.submit 'Rename team', class: "btn btn-remove"
  27 + = f.submit 'Edit team', class: "btn btn-remove"
23 28 = link_to 'Cancel', admin_teams_path, class: "btn btn-cancel"
... ...
app/views/admin/teams/index.html.haml
... ... @@ -16,6 +16,7 @@
16 16 %th
17 17 Name
18 18 %i.icon-sort-down
  19 + %th Description
19 20 %th Path
20 21 %th Projects
21 22 %th Members
... ... @@ -26,13 +27,14 @@
26 27 %tr
27 28 %td
28 29 %strong= link_to team.name, admin_team_path(team)
  30 + %td= team.description
29 31 %td= team.path
30 32 %td= team.projects.count
31 33 %td= team.members.count
32 34 %td
33 35 = link_to team.owner.name, admin_user_path(team.owner)
34 36 %td.bgred
35   - = link_to 'Rename', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small"
  37 + = link_to 'Edit', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small"
36 38 = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove"
37 39  
38 40 = paginate @teams, theme: "admin"
... ...
app/views/admin/teams/new.html.haml
... ... @@ -9,8 +9,15 @@
9 9 Team name is
10 10 .input
11 11 = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
12   - &nbsp;
13   - = f.submit 'Create team', class: "btn btn-primary"
  12 +
  13 + .clearfix.team_description_holder
  14 + = f.label :description, "Details"
  15 + .input
  16 + = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4
  17 +
  18 + .form-actions
  19 + = f.submit 'Create team', class: "btn btn-primary"
  20 +
14 21 %hr
15 22 .padded
16 23 %ul
... ...
app/views/admin/teams/show.html.haml
... ... @@ -16,7 +16,13 @@
16 16 &nbsp;
17 17 = link_to edit_admin_team_path(@team), 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 + = @team.description
20 26 %tr
21 27 %td
22 28 %b
... ...
app/views/dashboard/_teams.html.haml
1   -.ui-box.teams-box
  1 +.ui-box.teams_box
2 2 %h5.title
3 3 Teams
4 4 %small
... ... @@ -12,9 +12,11 @@
12 12 %li
13 13 = link_to team_path(id: team.path), class: dom_class(team) do
14 14 %strong.well-title= truncate(team.name, length: 35)
15   - %span.pull-right.light
16   - - if team.owner == current_user
17   - %i.icon-wrench
18   - - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id)
19   - - if tm
20   - = tm.access_human
  15 + %span.edit.light
  16 + - if team.owner == current_user
  17 + %i.icon-wrench
  18 + - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id)
  19 + - if tm
  20 + = tm.access_human
  21 + %span.description
  22 + %strong= team.description
... ...
db/migrate/20130207104426_add_description_to_teams.rb 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +class AddDescriptionToTeams < ActiveRecord::Migration
  2 + def change
  3 + add_column :user_teams, :description, :string, default: '', null: false
  4 + end
  5 +end
... ...