Commit c7933d7a78433f026bd4344667f6d4b270bfef15

Authored by Dmitriy Zaporozhets
1 parent 1afd93ee

Bootstrap: team

app/assets/stylesheets/commits.css.scss
... ... @@ -113,3 +113,24 @@ ul.bordered-list li:last-child { border:none }
113 113 tr.line_notes_row {
114 114 border-bottom:1px solid #DDD;
115 115 }
  116 +
  117 +/** FLASH **/
  118 +#flash_container {
  119 + height:45px;
  120 + position:fixed;
  121 + z-index:10001;
  122 + top:0px;
  123 + width:100%;
  124 + margin-bottom:15px;
  125 + overflow:hidden;
  126 + background:white;
  127 + cursor:pointer;
  128 + border-bottom:1px solid #777;
  129 +
  130 + h4 {
  131 + color:#444;
  132 + font-size:22px;
  133 + padding-top:5px;
  134 + margin:2px;
  135 + }
  136 +}
... ...
app/assets/stylesheets/common.scss
... ... @@ -138,6 +138,15 @@ img.avatar {
138 138 padding-right:5px;
139 139 }
140 140  
  141 +.media-grid {
  142 + h3, h2 , h4 {
  143 + &.media_h {
  144 + padding-left:10px;
  145 + float:left;
  146 + }
  147 + }
  148 +}
  149 +
141 150 @import "reset_bootstrap.scss";
142 151 @import "top_panel.scss";
143 152 @import "projects.css.scss";
... ...
app/assets/stylesheets/style.scss
... ... @@ -483,26 +483,6 @@ body, button, input, select, textarea {
483 483 border-width: 1px;
484 484 }
485 485  
486   -/** FLASH **/
487   -#flash_container {
488   - height:45px;
489   - position:fixed;
490   - z-index:10001;
491   - top:0px;
492   - width:100%;
493   - margin-bottom:15px;
494   - overflow:hidden;
495   - background:white;
496   - cursor:pointer;
497   - border-bottom:1px solid #777;
498   -
499   - h4 {
500   - color:#444;
501   - font-size:22px;
502   - padding-top:5px;
503   - margin:2px;
504   - }
505   -}
506 486  
507 487  
508 488 .errors_holder {
... ...
app/controllers/team_members_controller.rb
... ... @@ -40,7 +40,7 @@ class TeamMembersController < ApplicationController
40 40 @team_member.destroy
41 41  
42 42 respond_to do |format|
43   - format.html { redirect_to root_path }
  43 + format.html { redirect_to team_project_path(@project) }
44 44 format.js { render :nothing => true }
45 45 end
46 46 end
... ...
app/views/commits/show.html.haml
1 1 .commit
2 2 %span.commit-info
3   - = link_to tree_project_ref_path(@project, @commit.id), :class => "btn" do
  3 + = link_to tree_project_ref_path(@project, @commit.id), :class => "btn right" do
4 4 Browse Code »
5 5 - if @commit.author_email
6 6 = image_tag gravatar_icon(@commit.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
... ...
app/views/issues/index.html.haml
1   -- if can? current_user, :write_issue, @project
2   - = content_for :sidebar_top_block do
3   - - if current_user.can_create_project?
4   - .alert-message.block-message.error
5   - You are able to create an issue. Click on button to add a new one
6   - = link_to new_project_issue_path(@project), :class => "btn small", :title => "New Issue", :remote => true do
7   - New Issue
8   -
9 1 - if current_user.private_token
10 2 = content_for :rss_icon do
11 3 .rss-icon
... ... @@ -14,7 +6,11 @@
14 6  
15 7  
16 8 .issues_content
17   - %h3 Issues
  9 + %h3
  10 + Issues
  11 + - if can? current_user, :write_issue, @project
  12 + = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do
  13 + New Issue
18 14 %hr
19 15 %div#issues-table-holder
20 16 %ul.pills.left
... ...
app/views/layouts/_flash.html.haml
... ... @@ -10,7 +10,7 @@
10 10 $("#flash_container").click(function(){
11 11 $(this).slideUp("slow");
12 12 });
13   - setTimeout("hideFlash()",2000);
  13 + setTimeout("hideFlash()",3000);
14 14 });
15 15  
16 16 function hideFlash(){
... ...
app/views/layouts/_project_side_right.html.haml
1 1 %aside.project-right
2   - - if content_for? :sidebar_top_block
3   - = yield :sidebar_top_block
  2 + - if content_for? :sidebar_all
  3 + = render :sidebar_all
4 4 - else
5   - - if current_user.can_create_project?
6   - .alert-message.block-message.info
7   - You can create at least
8   - = current_user.projects_limit
9   - projects. Click on button to add a new one
10   - = link_to new_project_path, :class => "btn small" do
11   - New Project
  5 + - if content_for? :sidebar_top_block
  6 + = yield :sidebar_top_block
  7 + - else
  8 + - if can? current_user, :write_project, @project
  9 + %h4 Report
  10 + %ul
  11 + %li
  12 + = link_to new_project_issue_path(@project), :title => "New Issue", :class => "" do
  13 + New Issue »
  14 + %li
  15 + = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "" do
  16 + New Merge Request »
12 17  
13   - %h4
14   - Recent Projects:
15   - %ul
16   - - current_user.projects.order("id DESC").limit(5).each do |project|
17   - %li
18   - = link_to project_path(project) do
19   - = project.name
  18 + %h4
  19 + Recent Projects:
  20 + %ul
  21 + - current_user.projects.order("id DESC").limit(5).each do |project|
  22 + %li
  23 + = link_to project_path(project) do
  24 + = project.name
20 25  
21   - %h4
22   - Recent Issues:
23   - %ul
24   - - current_user.assigned_issues.order("id DESC").limit(5).each do |issue|
25   - %li
26   - = link_to project_issue_path(issue.project, issue) do
27   - = truncate issue.title
  26 + %h4
  27 + Recent Issues:
  28 + %ul
  29 + - current_user.assigned_issues.order("id DESC").limit(5).each do |issue|
  30 + %li
  31 + = link_to project_issue_path(issue.project, issue) do
  32 + = truncate issue.title
28 33  
29 34  
30   - %h4
31   - Recent Requests:
32   - %ul
33   - - current_user.assigned_merge_requests.order("id DESC").limit(5).each do |issue|
34   - %li
35   - = link_to project_merge_request_path(issue.project, issue) do
36   - = truncate issue.title
  35 + %h4
  36 + Recent Requests:
  37 + %ul
  38 + - current_user.assigned_merge_requests.order("id DESC").limit(5).each do |issue|
  39 + %li
  40 + = link_to project_merge_request_path(issue.project, issue) do
  41 + = truncate issue.title
37 42  
38 43  
... ...
app/views/notes/_per_line_form.html.haml
1 1 %table{:style => "display:none;"}
2 2 %tr.per_line_form
3 3 %td{:colspan => 3 }
4   - %div
  4 + %div.well
5 5 = form_for [@project, @note], :remote => "true", :multipart => true do |f|
  6 + %h3 Leave a note
6 7 -if @note.errors.any?
7   - .errors.error
  8 + .alert-message.block-message.error
8 9 - @note.errors.full_messages.each do |msg|
9 10 %div= msg
10 11  
11 12 = f.hidden_field :noteable_id
12 13 = f.hidden_field :noteable_type
13 14 = f.hidden_field :line_code
14   -
15   - %div
16   - = f.label :note
17   - %cite.cgray markdown supported
18   - %br
19   - %br
20   - = f.text_area :note, :size => 255
21   -
22   - .clear
23   - %br
24   - = f.submit 'Add note', :class => "positive-button", :id => "submit_note"
25   - .right
26   - = link_to "Close", "#", :class => "grey-button hide-button"
  15 + = f.text_area :note, :size => 255
  16 + .prepend-top-10
  17 + = f.submit 'Add note', :class => "btn primary", :id => "submit_note"
  18 + .right
  19 + = link_to "Close", "#", :class => "btn hide-button"
27 20  
28 21 :javascript
29 22 $(function(){
... ...
app/views/projects/_team.html.haml
1   -%table.no-borders#team-table
2   - %thead
3   - %th Name
4   - %th Project
5   - %th Repository
6   - - if can? current_user, :admin_team_member, @project
7   - %th Actions
  1 +%ul.media-grid
8 2 - @project.users_projects.each do |up|
9 3 = render(:partial => 'team_members/show', :locals => {:member => up})
10 4  
... ... @@ -15,5 +9,7 @@
15 9 });
16 10 })
17 11  
  12 + /*
18 13 $('.delete-team-member').live('ajax:success', function() {
19 14 $(this).closest('tr').fadeOut(); });
  15 + */
... ...
app/views/team_members/_show.html.haml
1 1 - user = member.user
2 2 - allow_admin = can? current_user, :admin_project, @project
3   -%tr{:id => dom_id(member)}
4   - %td
5   - = link_to image_tag(gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding:0 5px;"), project_team_member_path(@project, member)
  3 +%li{:id => dom_id(member)}
  4 + = link_to project_team_member_path(@project, member) do
  5 + = image_tag gravatar_icon(user.email, 90), :class => "thumbnail"
  6 + .row
  7 + .span6
  8 + %h4
  9 + = truncate(user.name, :lenght => 24)
  10 + %small= truncate user.email, :lenght => 24
6 11  
7   - = link_to truncate(user.name, :lenght => 24), project_team_member_path(@project, member)
8   - %br
9   - .cgray{:style => "padding-top:10px;"}= truncate user.email, :lenght => 24
10   - %td
  12 + .span3
11 13 = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
12   - = f.select :project_access, options_for_select(Project.access_options, member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin
13   - %td
  14 + = f.select :project_access, options_for_select(Project.access_options, member.project_access), {}, :class => "medium project-access-select", :disabled => !allow_admin
  15 + .span3
14 16 = form_for(member, :as => :team_member, :url => project_team_member_path(@project, member)) do |f|
15   - = f.select :repo_access, options_for_select(Repository.access_options, member.repo_access), {}, :class => "repo-access-select", :disabled => !allow_admin
16   - - if allow_admin
17   - %td
18   - = link_to 'Cancel', project_team_member_path(:project_id => @project, :id => member.id), :confirm => 'Are you sure?', :method => :delete, :class => "grey-button negative delete-team-member", :remote => true
19   -
  17 + = f.select :repo_access, options_for_select(Repository.access_options, member.repo_access), {}, :class => "medium repo-access-select", :disabled => !allow_admin
  18 + - if @project.owner == user
  19 + %span.label Project Owner
... ...
app/views/team_members/show.html.haml
1 1 - allow_admin = can? current_user, :admin_project, @project
2 2 - user = @team_member.user
3 3 %div
4   - %span.entity-info
5   - = link_to team_project_path(@project) do
6   - .entity-button
7   - Team
8   - %i
  4 + = link_to team_project_path(@project), :class => "btn right" do
  5 + Team »
9 6  
10   - = image_tag gravatar_icon(user.email), :class => "left", :width => 40, :style => "padding-right:5px;"
11   - %span.commit-title
12   - %strong
13   - = user.name
14   - %span.commit-author
15   - %strong
16   - = user.email
17   - %hr
18   - %br
  7 + .media-grid
  8 + = link_to "#" do
  9 + = image_tag gravatar_icon(user.email, 90), :class => "thumbnail"
  10 + %h3.media_h= user.name
19 11  
20 12 %table.no-borders
21 13 %tr
... ... @@ -59,9 +51,8 @@
59 51 %td= user.twitter
60 52  
61 53 - if can? current_user, :admin_project, @project
62   - .merge-tabs
63   - .right
64   - = link_to 'Remove from team', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "red-button"
  54 + .actions
  55 + = link_to 'Remove from team', project_team_member_path(:project_id => @project, :id => @team_member.id), :confirm => 'Are you sure?', :method => :delete, :class => "btn danger"
65 56  
66 57 :javascript
67 58 $(function(){
... ...