Commit 0a4222fb9802aa979171920c489a7db11e3f1ff8

Authored by Dmitriy Zaporozhets
1 parent 15b06b01

Bootstrap: Activities

app/assets/stylesheets/common.scss
@@ -133,9 +133,12 @@ aside.project-side @@ -133,9 +133,12 @@ aside.project-side
133 } 133 }
134 134
135 img.avatar { 135 img.avatar {
136 - width:32px;  
137 float:left; 136 float:left;
138 - padding-right:5px; 137 + margin-right:15px;
  138 + width:40px;
  139 + -webkit-border-radius: 4px;
  140 + -moz-border-radius: 4px;
  141 + border-radius: 4px;
139 } 142 }
140 143
141 .media-grid { 144 .media-grid {
@@ -147,6 +150,18 @@ img.avatar { @@ -147,6 +150,18 @@ img.avatar {
147 } 150 }
148 } 151 }
149 152
  153 +.wll {
  154 + background-color: #FFF;
  155 + margin-bottom: 10px;
  156 + padding: 5px;
  157 + min-height: 20px;
  158 + border-bottom: 1px solid #eee;
  159 + border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  160 + .author { color: #999; }
  161 + &:last-child { border:none }
  162 + p { padding-top:5px;}
  163 +}
  164 +
150 @import "reset_bootstrap.scss"; 165 @import "reset_bootstrap.scss";
151 @import "top_panel.scss"; 166 @import "top_panel.scss";
152 @import "projects.css.scss"; 167 @import "projects.css.scss";
app/assets/stylesheets/reset_bootstrap.scss
1 a { 1 a {
2 color: $link_color; 2 color: $link_color;
3 - &:hover { text-decoration:none; } 3 + &:hover {
  4 + text-decoration:none;
  5 + color: $active_link_color;
  6 + }
  7 +}
  8 +
  9 +.alert-message.entry {
  10 + background:#F1F1F1;
  11 + border-color:#ccc;
4 } 12 }
app/assets/stylesheets/top_panel.scss
1 -.main_links {  
2 - width:155px;  
3 - float:left;  
4 -  
5 - a {  
6 - float:left;  
7 - }  
8 -}  
9 -  
10 -.dashboard_links {  
11 - padding:7px;  
12 - float:left;  
13 - a {  
14 - margin: 0 14px;  
15 - float: left;  
16 - font-size: 14px;  
17 -  
18 - &.active {  
19 - color:$active_link_color;  
20 - }  
21 - &:hover {  
22 - color:$active_link_color;  
23 - }  
24 - }  
25 -}  
26 -  
27 -.top-tabs {  
28 - margin: 0;  
29 - padding: 5px;  
30 - font-size: 14px;  
31 - padding-bottom:10px;  
32 - margin-bottom:20px;  
33 - height:26px;  
34 - border-bottom:1px solid #ccc;  
35 -  
36 - .tab {  
37 - font-weight: bold;  
38 - background:none;  
39 - padding: 10px;  
40 - float:left;  
41 - padding-left:0px;  
42 - padding-right:40px;  
43 -  
44 - &.active {  
45 - color: $active_link_color;  
46 - }  
47 - }  
48 -}  
49 -  
50 body header { 1 body header {
51 position:absolute; 2 position:absolute;
52 width:100%; 3 width:100%;
@@ -54,12 +5,11 @@ body header { @@ -54,12 +5,11 @@ body header {
54 margin:0; 5 margin:0;
55 top:0; 6 top:0;
56 left:0; 7 left:0;
57 - background: #999; /* for non-css3 browsers */  
58 - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#EAEAEA'); /* for IE */  
59 - background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#EAEAEA)); /* for webkit browsers */  
60 - background: -moz-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */  
61 - background: -o-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */ 8 + background: #F1F1F1; /* for non-css3 browsers */
62 border-bottom: 1px solid #ccc; 9 border-bottom: 1px solid #ccc;
  10 + box-shadow: 0 -1px 0 white inset;
  11 + -moz-box-shadow: 0 -1px 0 white inset;
  12 + -webkit-box-shadow: 0 -1px 0 white inset;
63 13
64 height:50px; 14 height:50px;
65 15
@@ -105,6 +55,55 @@ body header { @@ -105,6 +55,55 @@ body header {
105 } 55 }
106 } 56 }
107 } 57 }
  58 +.main_links {
  59 + width:155px;
  60 + float:left;
  61 +
  62 + a {
  63 + float:left;
  64 + }
  65 +}
  66 +
  67 +.dashboard_links {
  68 + padding:7px;
  69 + float:left;
  70 + a {
  71 + margin: 0 14px;
  72 + float: left;
  73 + font-size: 14px;
  74 +
  75 + &.active {
  76 + color:$active_link_color;
  77 + }
  78 + &:hover {
  79 + color:$active_link_color;
  80 + }
  81 + }
  82 +}
  83 +
  84 +.top-tabs {
  85 + margin: 0;
  86 + padding: 5px;
  87 + font-size: 14px;
  88 + padding-bottom:10px;
  89 + margin-bottom:20px;
  90 + height:26px;
  91 + border-bottom:1px solid #ccc;
  92 +
  93 + .tab {
  94 + font-weight: bold;
  95 + background:none;
  96 + padding: 10px;
  97 + float:left;
  98 + padding-left:0px;
  99 + padding-right:40px;
  100 +
  101 + &.active {
  102 + color: $active_link_color;
  103 + }
  104 + }
  105 +}
  106 +
108 107
109 .top_panel_holder .chzn-container { 108 .top_panel_holder .chzn-container {
110 position:relative; 109 position:relative;
@@ -138,7 +137,6 @@ body header { @@ -138,7 +137,6 @@ body header {
138 .rss-icon { 137 .rss-icon {
139 margin:0 15px; 138 margin:0 15px;
140 padding:3px; 139 padding:3px;
141 - border:1px solid #AAA;  
142 border-radius:3px; 140 border-radius:3px;
143 float:left; 141 float:left;
144 } 142 }
app/controllers/merge_requests_controller.rb
@@ -39,6 +39,8 @@ class MergeRequestsController < ApplicationController @@ -39,6 +39,8 @@ class MergeRequestsController < ApplicationController
39 @notes = @merge_request.notes.inc_author.order("created_at DESC").limit(20) 39 @notes = @merge_request.notes.inc_author.order("created_at DESC").limit(20)
40 @note = @project.notes.new(:noteable => @merge_request) 40 @note = @project.notes.new(:noteable => @merge_request)
41 41
  42 + render_full_content
  43 +
42 respond_to do |format| 44 respond_to do |format|
43 format.html 45 format.html
44 format.js { respond_with_notes } 46 format.js { respond_with_notes }
app/controllers/projects_controller.rb
@@ -68,7 +68,8 @@ class ProjectsController < ApplicationController @@ -68,7 +68,8 @@ class ProjectsController < ApplicationController
68 68
69 def show 69 def show
70 return render "projects/empty" unless @project.repo_exists? && @project.has_commits? 70 return render "projects/empty" unless @project.repo_exists? && @project.has_commits?
71 - limit = (params[:limit] || 20).to_i 71 + limit = (params[:limit] || 10).to_i
  72 +
72 @activities = @project.activities(limit)#updates_wo_repo(limit) 73 @activities = @project.activities(limit)#updates_wo_repo(limit)
73 end 74 end
74 75
app/helpers/dashboard_helper.rb
@@ -3,6 +3,7 @@ module DashboardHelper @@ -3,6 +3,7 @@ module DashboardHelper
3 case object.class.name.to_s 3 case object.class.name.to_s
4 when "Issue" then project_issue_path(project, project.issues.find(object.id)) 4 when "Issue" then project_issue_path(project, project.issues.find(object.id))
5 when "Commit" then project_commit_path(project, project.repo.commits(object.id).first) 5 when "Commit" then project_commit_path(project, project.repo.commits(object.id).first)
  6 + when "MergeRequest" then project_merge_request_path(project, object.id)
6 when "Note" 7 when "Note"
7 then 8 then
8 note = object 9 note = object
@@ -26,6 +27,7 @@ module DashboardHelper @@ -26,6 +27,7 @@ module DashboardHelper
26 when "Note" then markdown(object.note) 27 when "Note" then markdown(object.note)
27 when "Issue" then object.title 28 when "Issue" then object.title
28 when "Commit" then object.safe_message 29 when "Commit" then object.safe_message
  30 + when "MergeRequest" then object.title
29 else return "Project Wall" 31 else return "Project Wall"
30 end 32 end
31 33
app/models/commit.rb
1 class Commit 1 class Commit
  2 + include ActiveModel::Conversion
  3 + extend ActiveModel::Naming
2 4
3 attr_accessor :commit 5 attr_accessor :commit
4 attr_accessor :head 6 attr_accessor :head
@@ -16,6 +18,10 @@ class Commit @@ -16,6 +18,10 @@ class Commit
16 :id, 18 :id,
17 :to => :commit 19 :to => :commit
18 20
  21 + def persisted?
  22 + false
  23 + end
  24 +
19 def initialize(raw_commit, head = nil) 25 def initialize(raw_commit, head = nil)
20 @commit = raw_commit 26 @commit = raw_commit
21 @head = head 27 @head = head
app/views/commits/_commits.html.haml
@@ -4,16 +4,17 @@ @@ -4,16 +4,17 @@
4 %h5.underlined= day.stamp("28 Aug, 2010") 4 %h5.underlined= day.stamp("28 Aug, 2010")
5 %ul.unstyled 5 %ul.unstyled
6 - commits.each do |commit| 6 - commits.each do |commit|
7 - %li 7 + %li.wll
8 %a{ :class => "update-item", :href => project_commit_path(@project, :id => commit.id) } 8 %a{ :class => "update-item", :href => project_commit_path(@project, :id => commit.id) }
9 .right.btn 9 .right.btn
10 = truncate(commit.id.to_s, :length => 10) 10 = truncate(commit.id.to_s, :length => 10)
11 » 11 »
12 = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 32 12 = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 32
13 - %div  
14 - %strong  
15 - = truncate(commit.safe_message, :length => 50)  
16 %span.update-author 13 %span.update-author
17 %strong= commit.author_name 14 %strong= commit.author_name
  15 + –
18 = time_ago_in_words(commit.committed_date) 16 = time_ago_in_words(commit.committed_date)
19 ago 17 ago
  18 + %p
  19 + %strong
  20 + = truncate(commit.safe_message, :length => 50)
app/views/dashboard/_issues_feed.html.haml
1 -#feeds_content_holder  
2 - - unless @issues.empty?  
3 - .project-box.project-updates.ui-box.ui-box-small.ui-box-big  
4 - .data  
5 - - @issues.each do |update|  
6 - %a.project-update{:href => dashboard_feed_path(update.project, update)}  
7 - .avatar= image_tag gravatar_icon(update.assignee_email), :class => "avatar", :width => 32  
8 - %div  
9 - = truncate update.title, :length => 35  
10 - .right= truncate update.project.name  
11 - %span.update-author  
12 - %strong= update.author_name  
13 - authored  
14 - = time_ago_in_words(update.created_at)  
15 - ago  
16 - .right  
17 - - if update.critical  
18 - %span.label.important critical  
19 - - if update.today?  
20 - %span.label.new today  
21 -  
22 - - else  
23 - %h2  
24 - No assigned  
25 - %span.tag.open open  
26 - issues 1 +- @issues.each do |issue|
  2 + .alert-message.entry
  3 + = link_to [issue.project, issue] do
  4 + %p
  5 + %strong
  6 + = issue.project.name
  7 + –
  8 + Issue #
  9 + = issue.id
  10 + = truncate issue.title, :length => 50
app/views/dashboard/_merge_requests_feed.html.haml
1 -#feeds_content_holder  
2 - - unless @merge_requests.empty?  
3 - .project-box.project-updates.ui-box.ui-box-small.ui-box-big  
4 - .data  
5 - - @merge_requests.each do |update|  
6 - %a.project-update{:href => project_merge_request_path(update.project, update)}  
7 - = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40  
8 - %span.update-title  
9 - = truncate update.title, :length => 35  
10 - .right= truncate update.project.name  
11 - %span.update-author  
12 - %strong= update.author_name  
13 - authored  
14 - = time_ago_in_words(update.created_at)  
15 - ago  
16 - .right  
17 - %span.tag.commit= update.source_branch  
18 - →  
19 - %span.tag.commit= update.target_branch  
20 - - else  
21 - %h2  
22 - No authored or assigned  
23 - %span.tag.open open  
24 - merge requests 1 +- @merge_requests.each do |merge_request|
  2 + .alert-message.entry
  3 + = link_to [merge_request.project, merge_request] do
  4 + %p
  5 + %strong
  6 + = merge_request.project.name
  7 + –
  8 + Issue #
  9 + = merge_request.id
  10 + = truncate merge_request.title, :length => 50
app/views/dashboard/_projects_feed.html.haml
1 -#feeds_content_holder  
2 - - @active_projects.first(3).each do |project|  
3 - .project-box.project-updates.ui-box.ui-box-small.ui-box-big  
4 - = link_to project do  
5 - %h4= project.name  
6 - - project.updates(3).each do |update|  
7 - %a.project-update{:href => dashboard_feed_path(project, update)}  
8 - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32  
9 - %div  
10 - = dashboard_feed_title(update)  
11 - %span.update-author  
12 - %strong= update.author_name  
13 - authored  
14 - = time_ago_in_words(update.created_at)  
15 - ago  
16 - .right  
17 - - klass = update.class.to_s.split("::").last.downcase  
18 - %span.tag{ :class => klass }= klass 1 +- @active_projects.first(3).each do |project|
  2 + = link_to project do
  3 + %h4= project.name
  4 + - project.updates(3).each do |update|
  5 + %a.project-update{:href => dashboard_feed_path(project, update)}
  6 + = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32
  7 + %div
  8 + = dashboard_feed_title(update)
  9 + %span.update-author
  10 + %strong= update.author_name
  11 + authored
  12 + = time_ago_in_words(update.created_at)
  13 + ago
  14 + .right
  15 + - klass = update.class.to_s.split("::").last.downcase
  16 + %span.tag{ :class => klass }= klass
19 17
app/views/dashboard/issues.html.haml
1 %h3 1 %h3
2 Issues 2 Issues
3 - %small ( authored or assigned to you ) 3 + %small ( assigned to you )
4 4
5 %hr 5 %hr
6 -.news-feed= render "dashboard/issues_feed" 6 += render "dashboard/issues_feed"
app/views/dashboard/merge_requests.html.haml
1 -%h3 Merge Requests 1 +%h3
  2 + Merge Requests
  3 + %small ( authored or assigned to you )
  4 +
2 %hr 5 %hr
3 -.news-feed= render "dashboard/merge_requests_feed" 6 += render "dashboard/merge_requests_feed"
app/views/layouts/_app_side.html.haml
1 .fixed 1 .fixed
2 %aside 2 %aside
3 - = link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }" 3 + -#= link_to "Activities", dashboard_path, :class => "#{"active" if current_page?(dashboard_path) || current_page?(root_path) }"
4 = link_to "Projects", projects_path, :class => "#{"active" if current_page?(projects_path)}" 4 = link_to "Projects", projects_path, :class => "#{"active" if current_page?(projects_path)}"
5 = link_to "Issues", dashboard_issues_path, :class => "#{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide" 5 = link_to "Issues", dashboard_issues_path, :class => "#{"active" if current_page?(dashboard_issues_path)}", :id => "issues_slide"
6 = link_to "Requests", dashboard_merge_requests_path, :class => "#{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" 6 = link_to "Requests", dashboard_merge_requests_path, :class => "#{"active" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide"
app/views/merge_requests/show.html.haml
  1 +%h3
  2 + = "Merge Request ##{@merge_request.id}:"
  3 +  
  4 + %span.label= @merge_request.source_branch
  5 + →
  6 + %span.label= @merge_request.target_branch
  7 +
  8 + %span.right
  9 + - if can?(current_user, :admin_project, @project) || @merge_request.author == current_user
  10 + = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small" do
  11 + Edit Merge Request
  12 +%hr
  13 +
1 %div 14 %div
2 %span.entity-info 15 %span.entity-info
3 - - if can?(current_user, :admin_project, @project) || @merge_request.author == current_user  
4 - = link_to edit_project_merge_request_path(@project, @merge_request) do  
5 - .entity-button  
6 - Edit Merge Request  
7 - %i  
8 = image_tag gravatar_icon(@merge_request.author_email), :class => "left", :width => 40, :style => "padding-right:5px;" 16 = image_tag gravatar_icon(@merge_request.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
9 %span.commit-title 17 %span.commit-title
10 %strong 18 %strong
11 - = "Merge Request ##{@merge_request.id}:"  
12 -    
13 - .tag.commit.inline= @merge_request.source_branch  
14 - →  
15 - .tag.commit.inline= @merge_request.target_branch  
16 - %span.commit-author 19 + %span.commit-author
17 %strong 20 %strong
18 = link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.author.id)) do 21 = link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.author.id)) do
19 %span.author= @merge_request.author_name 22 %span.author= @merge_request.author_name
20 → 23 →
21 = link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.assignee.id)) do 24 = link_to project_team_member_path(@project, @project.team_member_by_id(@merge_request.assignee.id)) do
22 %span.author= @merge_request.assignee_name 25 %span.author= @merge_request.assignee_name
23 -  
24 -    
25 -   26 + %br
26 = @merge_request.created_at.stamp("Aug 21, 2011 9:23pm") 27 = @merge_request.created_at.stamp("Aug 21, 2011 9:23pm")
27 -  
28 - %hr  
29 - %div.well= simple_format @merge_request.title 28 +%hr
  29 +.clearfix
  30 +%div.well= simple_format @merge_request.title
30 31
31 32
32 .tabs 33 .tabs
app/views/projects/_feed.html.haml
1 -- if update.kind_of?(Note)  
2 - %a.project-update.titled{:href => dashboard_feed_path(project, update)}  
3 - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32  
4 - %div  
5 - = dashboard_feed_title(update)  
6 - %span.update-author  
7 - %strong= update.author_name  
8 - = time_ago_in_words(update.created_at)  
9 - ago  
10 - - noteable = update.target  
11 - - if noteable.kind_of?(MergeRequest)  
12 - .title-block  
13 - %div  
14 - %span.commit.tag  
15 - Merge Request #  
16 - = noteable.id  
17 - %span.update-author  
18 - %span= noteable.source_branch 1 +%li.wll
  2 + .row
  3 + .span9
  4 + = image_tag gravatar_icon(update.author_email), :class => "avatar thumb"
  5 + %p
  6 + %strong.author= update.author_name
  7 + %span
  8 + –
  9 + authored
  10 + = time_ago_in_words(update.created_at)
  11 + ago
  12 + - if update.kind_of? MergeRequest
  13 + = link_to project_merge_request_path(@project, update) do
  14 + = "Opened merge request ##{update.id}."
  15 + %span.label= update.source_branch
19 → 16 →
20 - %span= noteable.target_branch  
21 -  
22 - - elsif noteable.kind_of?(Issue)  
23 - .title-block  
24 - %div  
25 - %span.commit.tag  
26 - Issue #  
27 - = noteable.id  
28 - %span.update-author  
29 - .left= truncate noteable.title  
30 -  
31 - - elsif noteable.kind_of?(Commit)  
32 - .title-block  
33 - %div  
34 - %span.commit.tag  
35 - commit  
36 - %span.update-author  
37 - .left= truncate noteable.id  
38 - - else  
39 - .title-block  
40 - %div  
41 - %span.commit.tag  
42 - Project Wall  
43 -  
44 -  
45 -- elsif update.kind_of?(MergeRequest)  
46 - %a.project-update.titled{:href => project_merge_request_path(project, update)}  
47 - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32  
48 - %div  
49 - Opened merge request  
50 - %span.update-author  
51 - %strong= update.author_name  
52 - = time_ago_in_words(update.created_at)  
53 - ago  
54 - .title-block  
55 - %div  
56 - %span.commit.tag  
57 - Merge Request #  
58 - = update.id  
59 - %span.update-author  
60 - %span= update.source_branch  
61 - →  
62 - %span= update.target_branch  
63 -  
64 -- elsif update.kind_of?(Issue)  
65 - %a.project-update.titled{:href => dashboard_feed_path(project, update)}  
66 - = image_tag gravatar_icon(update.author_email), :class => "avatar", :width => 32  
67 - %div  
68 - Created new Issue  
69 - %span.update-author  
70 - %strong= update.author_name  
71 - = time_ago_in_words(update.created_at)  
72 - ago  
73 - .title-block  
74 - %div  
75 - %span.commit.tag  
76 - Issue #  
77 - = update.id  
78 - %span.update-author  
79 - .left= truncate update.title 17 + %span.label= update.target_branch
  18 + - elsif update.kind_of? Issue
  19 + = link_to project_issue_path(@project, update) do
  20 + Opened new
  21 + %span.label.important= "issue ##{update.id}"
  22 + = truncate update.title
  23 + - else
  24 + = link_to [@project, update.target] do
  25 + %p
  26 + = update.target.class.name.titleize
  27 + = truncate(update.target.id.to_s, :length => 10)
  28 +  
  29 + = dashboard_feed_title(update)
app/views/projects/_form.html.haml
@@ -18,10 +18,10 @@ @@ -18,10 +18,10 @@
18 %cite= "http://#{GIT_HOST["host"]}/" 18 %cite= "http://#{GIT_HOST["host"]}/"
19 .input= f.text_field :code, :placeholder => "example" 19 .input= f.text_field :code, :placeholder => "example"
20 20
21 - - unless @project.new_record? || @project.heads.empty?  
22 - .clearfix  
23 - = f.label :default_branch, "Default Branch"  
24 - .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;") 21 + - unless @project.new_record? || @project.heads.empty?
  22 + .clearfix
  23 + = f.label :default_branch, "Default Branch"
  24 + .input= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:210px;")
25 25
26 26
27 .clearfix 27 .clearfix
@@ -30,9 +30,9 @@ @@ -30,9 +30,9 @@
30 30
31 %br 31 %br
32 32
33 - .merge-tabs 33 + .actions
34 = f.submit 'Save', :class => "btn primary" 34 = f.submit 'Save', :class => "btn primary"
35 -   35 + = link_to 'Cancel', @project, :class => "btn"
36 - unless @project.new_record? 36 - unless @project.new_record?
37 .right 37 .right
38 - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn" 38 + = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "btn danger"
app/views/projects/edit.html.haml
1 = render "project_head" 1 = render "project_head"
2 -  
3 -= form_for(@project, :remote => true) do |f|  
4 - %div  
5 - %span.entity-info  
6 - = link_to info_project_path(@project) do  
7 - .entity-button  
8 - Info  
9 - %i  
10 - %h2= @project.name  
11 - %hr  
12 - %table.no-borders  
13 - -if @project.errors.any?  
14 - %tr  
15 - %td{:colspan => 2}  
16 - #error_explanation  
17 - - @project.errors.full_messages.each do |msg|  
18 - %span= msg  
19 - %br  
20 -  
21 - %tr  
22 - %td= f.label :name  
23 - %td= f.text_field :name, :placeholder => "Example Project"  
24 - %tr  
25 - %td  
26 - .left= f.label :path  
27 - %cite.right= "git@#{GIT_HOST["host"]}:"  
28 - %td  
29 - = f.text_field :path, :placeholder => "example_project", :disabled => !@project.new_record?  
30 - %tr  
31 - %td  
32 - .left= f.label :code  
33 - %cite.right= "http://#{GIT_HOST["host"]}/"  
34 - %td= f.text_field :code, :placeholder => "example"  
35 -  
36 - - unless @project.new_record? || @project.heads.empty?  
37 - %tr  
38 - %td= f.label :default_branch, "Default Branch"  
39 - %td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")  
40 -  
41 - %tr  
42 - %td= f.label :description  
43 - %td= f.text_area :description, :placeholder => "project description", :style => "height:50px"  
44 -  
45 - %br  
46 -  
47 - .merge-tabs  
48 - = f.submit 'Save', :class => "grey-button"  
49 -    
50 - - unless @project.new_record?  
51 - .right  
52 - = link_to 'Remove', @project, :confirm => 'Are you sure?', :method => :delete, :class => "red-button"  
53 - 2 +%h3 Edit Project
  3 +%hr
  4 += render "projects/form"
54 %div{ :class => "ajax_loader", :style => "display:none;height:200px;"} 5 %div{ :class => "ajax_loader", :style => "display:none;height:200px;"}
55 %center 6 %center
56 = image_tag "ajax-loader.gif", :class => "append-bottom" 7 = image_tag "ajax-loader.gif", :class => "append-bottom"
57 - %h3.prepend-top Updating project & repository. Please wait for few minutes 8 + %h3.prepend-top Saving project & repository. Please wait...
58 9
59 :javascript 10 :javascript
60 - $('.edit_project').bind('ajax:before', function() {  
61 - $(".edit_project").hide();  
62 - $('.ajax_loader').show(); 11 + $(function(){
  12 + $("#project_name").live("change", function(){
  13 + var slug = slugify($(this).val());
  14 + $("#project_code").val(slug);
  15 + $("#project_path").val(slug);
  16 + });
63 }); 17 });
64 18
65 -:javascript 19 + function slugify(text) {
  20 + return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
  21 + }
  22 +
66 $(function(){ 23 $(function(){
67 - $('#project_default_branch').chosen(); 24 + $('.edit_project').live('ajax:before', function() {
  25 + $(this).hide();
  26 + $('.ajax_loader').show();
  27 + });
  28 + $('form #project_default_branch').chosen();
68 }) 29 })
69 -  
app/views/projects/empty.html.haml
1 - if current_user.require_ssh_key? 1 - if current_user.require_ssh_key?
2 - %ul.errors_holder  
3 - %li You have no ssh keys added yo tour profile.  
4 - %li You wont be able to pull/push repository.  
5 - %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq. 2 + .alert-message.block-message.error
  3 + %ul
  4 + %li You have no ssh keys added yo tour profile.
  5 + %li You wont be able to pull/push repository.
  6 + %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq.
6 7
7 -  
8 -%ul.alert_holder  
9 - %li You should push repository to proceed.  
10 - %li After push you will be able to browse code, commits etc. 8 +.alert-message.block-message.error
  9 + %ul.alert_holder
  10 + %li You should push repository to proceed.
  11 + %li After push you will be able to browse code, commits etc.
11 12
12 - bash_lexer = Pygments::Lexer[:bash] 13 - bash_lexer = Pygments::Lexer[:bash]
13 %div.git-empty 14 %div.git-empty
app/views/projects/index.html.haml
1 -%h3 Projects 1 +%h3
  2 + Projects
  3 + %small= "( #{current_user.projects.count} )"
2 %hr 4 %hr
3 - unless @projects.empty? 5 - unless @projects.empty?
4 %div.tile= render "tile" 6 %div.tile= render "tile"
app/views/projects/info.html.haml
1 = render "project_head" 1 = render "project_head"
  2 +%h3= @project.name
  3 +%br
2 4
3 -%div  
4 - %span.entity-info  
5 - = link_to edit_project_path(@project) do  
6 - .entity-button  
7 - Edit  
8 - %i  
9 - %h2= @project.name  
10 - %hr 5 +
  6 +
  7 +%pre
  8 + = "git clone #{@project.url_to_repo}"
11 9
12 -%table.no-borders 10 +
  11 +%table
13 %tr 12 %tr
14 %td Name 13 %td Name
15 %td= @project.name 14 %td= @project.name
@@ -17,6 +16,36 @@ @@ -17,6 +16,36 @@
17 %tr 16 %tr
18 %td Slug 17 %td Slug
19 %td= @project.code 18 %td= @project.code
  19 +
  20 + %tr
  21 + %td Path
  22 + %td= @project.path
  23 +
  24 + %tr
  25 + %td Owner
  26 + %td= link_to @project.owner.name, project_team_member_path(@project, @project.team_member_by_id(@project.owner))
  27 +
  28 + %tr
  29 + %td Last commit
  30 + %td
  31 + = time_ago_in_words(@project.commit.committed_date)
  32 + ago
  33 +
  34 + %tr
  35 + %td Team
  36 + %td
  37 + = @project.users_projects.count
  38 + users
  39 +
  40 + %tr
  41 + %td Open Issues
  42 + %td
  43 + = @project.issues.opened.count
  44 +
  45 + %tr
  46 + %td Merge Requests
  47 + %td
  48 + = @project.merge_requests.opened.count
20 49
21 %tr 50 %tr
22 %td Created 51 %td Created
@@ -25,4 +54,6 @@ @@ -25,4 +54,6 @@
25 %tr 54 %tr
26 %td{:colspan => 2}= simple_format @project.description 55 %td{:colspan => 2}= simple_format @project.description
27 56
  57 +.actions
  58 + = link_to "Edit", edit_project_path(@project), :class => "btn"
28 59
app/views/projects/show.html.haml
1 -- content_for(:body_class, "project-page dashboard")  
2 -  
3 = render "project_head" 1 = render "project_head"
4 -#news-feed.news-feed  
5 - .project-box.project-updates  
6 - - @activities.each do |update|  
7 - = render "projects/feed", :update => update, :project => @project  
8 -  
9 -:javascript  
10 - function updateDashboard(){  
11 - $('.project-content').load("#{escape_javascript(project_path(@project))} .project-content>*");  
12 - }  
13 - setInterval("updateDashboard()", 300000); 2 +- @activities.each do |update|
  3 + .alert-message.entry
  4 + = link_to dashboard_feed_path(@project, update) do
  5 + - if update.kind_of? Note
  6 + %p
  7 + %strong
  8 + = update.target.class.name.titleize
  9 + = truncate update.target.id.to_s, :length => 10
  10 + commented
  11 + –
  12 + = image_tag gravatar_icon(update.author_email), :class => "", :width => 16
  13 + = truncate dashboard_feed_title(update), :length => 50
  14 + - else
  15 + %p
  16 + %strong
  17 + = update.class.name.titleize
  18 + = truncate update.id.to_s
  19 + –
  20 + = image_tag gravatar_icon(update.author_email), :class => "", :width => 16
  21 + = truncate dashboard_feed_title(update), :length => 50
app/views/repositories/_feed.html.haml
1 -%a.project-update.titled{:href => project_commits_path(project, :ref => update.head.name)}  
2 - = image_tag gravatar_icon(update.author_email), :class => "left", :width => 40  
3 - %span.update-title  
4 - = dashboard_feed_title(update)  
5 - %span.update-author  
6 - %strong= update.author_name  
7 - authored  
8 - = time_ago_in_words(update.created_at)  
9 - ago  
10 - .title-block  
11 - %span.update-title  
12 - %span.commit.tag= update.head.name  
13 - %span.update-author  
14 - .left= truncate update.commit.id  
15 - 1 +- commit = update
  2 +.alert-message.entry
  3 + = link_to project_commits_path(@project, :ref => commit.head.name) do
  4 + %p
  5 + %strong
  6 + = commit.head.name
  7 + –
  8 + = truncate(commit.id.to_s, :length => 10)
  9 + = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16
  10 + = truncate(commit.safe_message, :length => 40)
  11 + %span.right
  12 + = time_ago_in_words(commit.committed_date)
  13 + ago
app/views/repositories/branches.html.haml
1 = render "head" 1 = render "head"
2 - unless @branches.empty? 2 - unless @branches.empty?
3 - %div.update-data.ui-box.ui-box-small  
4 - .data 3 + %table
  4 + %thead
  5 + %tr
  6 + %th Name
  7 + %th Last commit
  8 + %tbody
5 - @branches.each do |branch| 9 - @branches.each do |branch|
6 - %a.update-item{:href => project_commits_path(@project, :ref => branch.name)}  
7 - %span.update-title{:style => "margin-bottom:0px;"}  
8 - = branch.name  
9 - %span.update-author.right  
10 - = time_ago_in_words(branch.commit.committed_date)  
11 - ago  
12 -- else  
13 - %h3 No brances 10 + %tr
  11 + %td
  12 + = link_to project_commits_path(@project, :ref => branch.name) do
  13 + %strong= branch.name
  14 + - if branch.name == @project.root_ref
  15 + %span.label default
  16 + %td
  17 + = link_to project_commits_path(@project, branch.commit.id) do
  18 + = truncate branch.commit.id.to_s, :length => 10
  19 + = time_ago_in_words(branch.commit.committed_date)
  20 + ago
app/views/repositories/show.html.haml
1 -- content_for(:body_class, "project-page dashboard")  
2 = render "head" 1 = render "head"
3 -  
4 -#news-feed.news-feed  
5 - .project-box.project-updates  
6 - - @activities.each do |update|  
7 - = render "repositories/feed", :update => update, :project => @project 2 +%ul.unstyled
  3 + - @activities.each do |update|
  4 + = render "repositories/feed", :update => update, :project => @project
8 5
config/routes.rb
@@ -106,5 +106,5 @@ Gitlab::Application.routes.draw do @@ -106,5 +106,5 @@ Gitlab::Application.routes.draw do
106 end 106 end
107 resources :notes, :only => [:create, :destroy] 107 resources :notes, :only => [:create, :destroy]
108 end 108 end
109 - root :to => "dashboard#index" 109 + root :to => "projects#index"
110 end 110 end