Commit 94db8a1c334b9ff5a0c28c89cb87ffa882095261

Authored by Dmitriy Zaporozhets
1 parent 9a24ccde

Usability & design improvements

app/assets/stylesheets/common.scss
@@ -10,8 +10,12 @@ a { @@ -10,8 +10,12 @@ a {
10 color: $link_color !important; 10 color: $link_color !important;
11 } 11 }
12 12
  13 +.pills a:hover {
  14 + background-color:#ccc;
  15 +}
  16 +
13 .pills .active a { 17 .pills .active a {
14 - background-color: #474D57; 18 + background-color: #aaa;
15 } 19 }
16 20
17 .label { 21 .label {
@@ -83,7 +87,7 @@ a { @@ -83,7 +87,7 @@ a {
83 } 87 }
84 88
85 .container .sidebar { 89 .container .sidebar {
86 - width: 250px; 90 + width: 220px;
87 height:100%; 91 height:100%;
88 min-height:450px; 92 min-height:450px;
89 float:right; 93 float:right;
@@ -131,6 +135,15 @@ nav.main_menu { @@ -131,6 +135,15 @@ nav.main_menu {
131 margin: 0; 135 margin: 0;
132 float:left; 136 float:left;
133 text-shadow:0 1px 1px white; 137 text-shadow:0 1px 1px white;
  138 +
  139 + &.home {
  140 + padding:7px 35px;
  141 +
  142 + img {
  143 + position:relative;
  144 + top:4px;
  145 + }
  146 + }
134 &.current { 147 &.current {
135 background:#DDD; 148 background:#DDD;
136 } 149 }
@@ -182,7 +195,7 @@ img.lil_av { @@ -182,7 +195,7 @@ img.lil_av {
182 p { padding-top:5px; margin:0; color:$style_color;} 195 p { padding-top:5px; margin:0; color:$style_color;}
183 .author { color: #999; } 196 .author { color: #999; }
184 p { 197 p {
185 - color:$style_color; 198 + color:#222;
186 margin-bottom: 0; 199 margin-bottom: 0;
187 img { 200 img {
188 position:relative; 201 position:relative;
@@ -230,6 +243,27 @@ img.lil_av { @@ -230,6 +243,27 @@ img.lil_av {
230 .widget { 243 .widget {
231 padding:20px; 244 padding:20px;
232 margin-bottom:20px; 245 margin-bottom:20px;
  246 + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #fff), to(#f1f1f1));
  247 + background-image: -webkit-linear-gradient(#fff 6.6%, #f1f1f1);
  248 + background-image: -moz-linear-gradient(#fff 6.6%, #f1f1f1);
  249 + background-image: -o-linear-gradient(#fff 6.6%, #f1f1f1);
  250 + border: 1px solid #DDD;
  251 + border-radius: 5px;
  252 +
  253 + .link_holder {
  254 + background:#eee;
  255 + position:relative;
  256 + left:-20px;
  257 + top:20px;
  258 + padding:10px 20px;
  259 + width:100%;
  260 + border-top:1px solid #ccc;
  261 +
  262 + a {
  263 + font-size:14px;
  264 + color:#666;
  265 + }
  266 + }
233 } 267 }
234 268
235 269
@@ -242,15 +276,20 @@ img.lil_av { @@ -242,15 +276,20 @@ img.lil_av {
242 margin:0; 276 margin:0;
243 } 277 }
244 278
245 - h5 { 279 + h5, .title {
246 padding: 0 10px; 280 padding: 0 10px;
247 background:#f5f5f5; 281 background:#f5f5f5;
248 border-bottom: 1px solid #ccc; 282 border-bottom: 1px solid #ccc;
249 @include round-borders-top(4px); 283 @include round-borders-top(4px);
250 border-top:none; 284 border-top:none;
  285 +
  286 + form {
  287 + padding-top:16px;
  288 + }
251 } 289 }
252 290
253 - li { 291 +
  292 + li, .wll {
254 padding:10px; 293 padding:10px;
255 &:first-child { 294 &:first-child {
256 @include round-borders-top(4px); 295 @include round-borders-top(4px);
@@ -266,3 +305,11 @@ img.lil_av { @@ -266,3 +305,11 @@ img.lil_av {
266 } 305 }
267 306
268 .help li { color:#111 } 307 .help li { color:#111 }
  308 +
  309 +.back_link {
  310 + text-decoration:underline;
  311 + font-size:14px;
  312 + font-weight:bold;
  313 + padding:10px 0;
  314 + padding-bottom:0;
  315 +}
app/assets/stylesheets/tree.scss
@@ -130,14 +130,21 @@ table.highlighttable .linenodiv pre { @@ -130,14 +130,21 @@ table.highlighttable .linenodiv pre {
130 } 130 }
131 } 131 }
132 132
133 -.breadcrumb a {  
134 - color:$style_color;  
135 - font-weight:bold; 133 +.breadcrumb {
  134 + background:white;
  135 + border:none;
  136 +
  137 + a {
  138 + color:$link_color;
  139 + font-weight:bold;
  140 + font-size:13px;
  141 + }
136 } 142 }
137 143
138 #tree-slider { 144 #tree-slider {
139 td { 145 td {
140 padding:7px; 146 padding:7px;
  147 + border-color:#f1f1f1;
141 } 148 }
142 149
143 th { 150 th {
app/controllers/merge_requests_controller.rb
@@ -24,7 +24,9 @@ class MergeRequestsController < ApplicationController @@ -24,7 +24,9 @@ class MergeRequestsController < ApplicationController
24 @merge_requests = @project.merge_requests 24 @merge_requests = @project.merge_requests
25 25
26 @merge_requests = case params[:f].to_i 26 @merge_requests = case params[:f].to_i
  27 + when 1 then @merge_requests
27 when 2 then @merge_requests.closed 28 when 2 then @merge_requests.closed
  29 + when 2 then @merge_requests.opened.assigned(current_user)
28 else @merge_requests.opened 30 else @merge_requests.opened
29 end 31 end
30 32
app/models/commit.rb
@@ -42,7 +42,7 @@ class Commit @@ -42,7 +42,7 @@ class Commit
42 end 42 end
43 43
44 def author_name 44 def author_name
45 - author.name 45 + author.name.force_encoding("UTF-8")
46 end 46 end
47 47
48 def committer_name 48 def committer_name
app/models/user.rb
@@ -65,7 +65,11 @@ class User < ActiveRecord::Base @@ -65,7 +65,11 @@ class User < ActiveRecord::Base
65 65
66 def self.generate_random_password 66 def self.generate_random_password
67 (0...8).map{ ('a'..'z').to_a[rand(26)] }.join 67 (0...8).map{ ('a'..'z').to_a[rand(26)] }.join
68 - end 68 + end
  69 +
  70 + def first_name
  71 + name.split(" ").first unless name.blank?
  72 + end
69 73
70 def self.find_for_ldap_auth(omniauth) 74 def self.find_for_ldap_auth(omniauth)
71 username = omniauth.sAMAccountName[0] 75 username = omniauth.sAMAccountName[0]
app/views/issues/_show.html.haml
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 = image_tag gravatar_icon(issue.assignee_email), :class => "avatar" 12 = image_tag gravatar_icon(issue.assignee_email), :class => "avatar"
13 %span.update-author 13 %span.update-author
14 assigned to 14 assigned to
15 - %strong= link_to_issue_assignee(issue) 15 + %strong= issue.assignee_name
16 - if issue.critical 16 - if issue.critical
17 %span.label.important critical 17 %span.label.important critical
18 - if issue.today? 18 - if issue.today?
app/views/issues/index.html.haml
@@ -9,30 +9,30 @@ @@ -9,30 +9,30 @@
9 = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do 9 = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do
10 New Issue 10 New Issue
11 %hr 11 %hr
12 - %div#issues-table-holder  
13 - .row  
14 - .span8  
15 - %ul.pills.left  
16 - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}  
17 - = link_to project_issues_path(@project, :f => 0) do  
18 - Open  
19 - %li{:class => ("active" if params[:f] == "2")}  
20 - = link_to project_issues_path(@project, :f => 2) do  
21 - Closed  
22 - %li{:class => ("active" if params[:f] == "3")}  
23 - = link_to project_issues_path(@project, :f => 3) do  
24 - To Me  
25 - %li{:class => ("active" if params[:f] == "1")}  
26 - = link_to project_issues_path(@project, :f => 1) do  
27 - All 12 + %div#issues-table-holder.ui-box
  13 + .title
  14 + .row
  15 + .span8
  16 + %ul.pills.left
  17 + %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
  18 + = link_to project_issues_path(@project, :f => 0) do
  19 + Open
  20 + %li{:class => ("active" if params[:f] == "2")}
  21 + = link_to project_issues_path(@project, :f => 2) do
  22 + Closed
  23 + %li{:class => ("active" if params[:f] == "3")}
  24 + = link_to project_issues_path(@project, :f => 3) do
  25 + To Me
  26 + %li{:class => ("active" if params[:f] == "1")}
  27 + = link_to project_issues_path(@project, :f => 1) do
  28 + All
28 29
29 - .span2.right  
30 - = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do  
31 - = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }  
32 - = hidden_field_tag :status, params[:f]  
33 - = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } 30 + .span3.right
  31 + = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do
  32 + = hidden_field_tag :project_id, @project.id, { :id => 'project_id' }
  33 + = hidden_field_tag :status, params[:f]
  34 + = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' }
34 35
35 - %hr  
36 %ul#issues-table.unstyled= render "issues" 36 %ul#issues-table.unstyled= render "issues"
37 37
38 :javascript 38 :javascript
app/views/issues/show.html.haml
@@ -14,6 +14,11 @@ @@ -14,6 +14,11 @@
14 = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do 14 = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do
15 Edit 15 Edit
16 16
  17 +.back_link
  18 + = link_to project_issues_path(@project) do
  19 + ← To issues list
  20 +
  21 +
17 %hr 22 %hr
18 - if @issue.closed 23 - if @issue.closed
19 .alert-message.error Closed 24 .alert-message.error Closed
app/views/keys/index.html.haml
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 %hr 5 %hr
6 6
7 -%div#keys-table{ :class => "update-data ui-box ui-box-small ui-box-big" } 7 +%div#keys-table
8 %ul.unstyled 8 %ul.unstyled
9 - @keys.each do |key| 9 - @keys.each do |key|
10 = render(:partial => 'show', :locals => {:key => key}) 10 = render(:partial => 'show', :locals => {:key => key})
app/views/layouts/_project_menu.html.haml
1 %nav.main_menu 1 %nav.main_menu
2 - = link_to project_path(@project), :class => project_tab_class do 2 + = link_to project_path(@project), :class => "#{project_tab_class}", :title => "Project" do
3 Project 3 Project
4 4
5 - if @project.repo_exists? 5 - if @project.repo_exists?
app/views/layouts/_projects_side.html.haml
@@ -4,16 +4,16 @@ @@ -4,16 +4,16 @@
4 You can create at least 4 You can create at least
5 = current_user.projects_limit 5 = current_user.projects_limit
6 projects. Click on button to add a new one 6 projects. Click on button to add a new one
7 - %hr  
8 - = link_to new_project_path, :class => "btn small" do  
9 - New Project » 7 + .link_holder
  8 + = link_to new_project_path, :class => "" do
  9 + New Project »
10 10
11 - if current_user.is_admin? 11 - if current_user.is_admin?
12 .widget 12 .widget
13 You have administrator privilegies. You can configure application following this button: 13 You have administrator privilegies. You can configure application following this button:
14 - %hr  
15 - = link_to admin_root_path, :class => "btn small", :title => "Admin" do  
16 - Visit Admin Area » 14 + .link_holder
  15 + = link_to admin_root_path, :class => "", :title => "Admin" do
  16 + Visit Admin Area »
17 17
18 - if current_user.projects.count > 0 18 - if current_user.projects.count > 0
19 = render "widgets/recent_projects" 19 = render "widgets/recent_projects"
app/views/layouts/profile.html.haml
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 = link_to "Password & token", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil 10 = link_to "Password & token", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil
11 = link_to "Design", profile_design_path, :class => current_page?(:controller => "profile", :action => :design) ? "current" : nil 11 = link_to "Design", profile_design_path, :class => current_page?(:controller => "profile", :action => :design) ? "current" : nil
12 = link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do 12 = link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do
13 - Keys 13 + SSH Keys
14 .content 14 .content
15 .row 15 .row
16 .span12= yield 16 .span12= yield
app/views/merge_requests/_merge_request.html.haml
1 %li.wll 1 %li.wll
2 = image_tag gravatar_icon(merge_request.author_email), :class => "avatar" 2 = image_tag gravatar_icon(merge_request.author_email), :class => "avatar"
3 %span.update-author 3 %span.update-author
4 - %strong= link_to_merge_request_author(merge_request) 4 + %strong= merge_request.author_name
5 authored 5 authored
6 = time_ago_in_words(merge_request.created_at) 6 = time_ago_in_words(merge_request.created_at)
7 ago 7 ago
app/views/merge_requests/index.html.haml
@@ -6,14 +6,21 @@ @@ -6,14 +6,21 @@
6 6
7 %hr 7 %hr
8 8
9 -%ul.pills  
10 - %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}  
11 - = link_to project_merge_requests_path(@project, :f => 0) do  
12 - Open  
13 - %li{:class => ("active" if params[:f] == "2")}  
14 - = link_to project_merge_requests_path(@project, :f => 2) do  
15 - Closed 9 +.ui-box
  10 + .title
  11 + %ul.pills
  12 + %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
  13 + = link_to project_merge_requests_path(@project, :f => 0) do
  14 + Open
  15 + %li{:class => ("active" if params[:f] == "2")}
  16 + = link_to project_merge_requests_path(@project, :f => 2) do
  17 + Closed
  18 + %li{:class => ("active" if params[:f] == "3")}
  19 + = link_to project_merge_requests_path(@project, :f => 3) do
  20 + To Me
  21 + %li{:class => ("active" if params[:f] == "1")}
  22 + = link_to project_merge_requests_path(@project, :f => 1) do
  23 + All
16 24
17 -%hr  
18 -%ul.unstyled= render @merge_requests 25 + %ul.unstyled= render @merge_requests
19 26
app/views/merge_requests/show.html.haml
@@ -19,6 +19,9 @@ @@ -19,6 +19,9 @@
19 = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small" do 19 = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small" do
20 Edit 20 Edit
21 21
  22 +.back_link
  23 + = link_to project_merge_requests_path(@project) do
  24 + ← To merge requests
22 %hr 25 %hr
23 - if @merge_request.closed 26 - if @merge_request.closed
24 .alert-message.error Closed 27 .alert-message.error Closed
app/views/projects/show.html.haml
1 = render "project_head" 1 = render "project_head"
2 %h3 2 %h3
3 = @project.name 3 = @project.name
  4 + - if can? current_user, :download_code, @project
  5 + = link_to "Download", archive_project_repository_path(@project), :class => "btn small right"
  6 +.back_link
  7 + = link_to projects_path do
  8 + ← To projects list
4 %hr 9 %hr
5 .alert-message.block-message.warning 10 .alert-message.block-message.warning
6 .input 11 .input
@@ -10,7 +15,8 @@ @@ -10,7 +15,8 @@
10 15
11 = simple_format @project.description 16 = simple_format @project.description
12 17
13 -%h5.cgray Recent Activity  
14 -.content_list= render "feed" 18 +.ui-box
  19 + %h5.cgray Recent Activity
  20 + .content_list= render "feed"
15 21
16 22
app/views/repositories/show.html.haml
@@ -6,6 +6,16 @@ @@ -6,6 +6,16 @@
6 6
7 7
8 %hr 8 %hr
  9 +.entry
  10 + %p
  11 + Last commit was
  12 + %small
  13 + %code= @activities.first.commit.id.to_s[0..10]
  14 +
  15 + = time_ago_in_words(@activities.first.commit.committed_date)
  16 + ago to
  17 + = link_to project_commits_path(@project, :ref => @activities.first.head.name), :class => "visible_link" do
  18 + %span.label= @activities.first.head.name
9 .alert-message.block-message.warning 19 .alert-message.block-message.warning
10 .input 20 .input
11 .input-prepend 21 .input-prepend
@@ -13,20 +23,12 @@ @@ -13,20 +23,12 @@
13 = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url" 23 = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url"
14 24
15 25
16 -%p  
17 - Last commit was  
18 - %small  
19 - %code= @activities.first.commit.id.to_s[0..10]  
20 26
21 - = time_ago_in_words(@activities.first.commit.committed_date)  
22 - ago to  
23 - = link_to project_commits_path(@project, :ref => @activities.first.head.name), :class => "visible_link" do  
24 - %span.label= @activities.first.head.name 27 +.ui-box
  28 + %h5.cgray
  29 + Recent Branches
25 30
26 -%h4.cgray  
27 - Recent Branches  
28 -  
29 -%ul.unstyled  
30 - - @activities.each do |update|  
31 - = render "repositories/feed", :update => update, :project => @project 31 + %ul.unstyled
  32 + - @activities.each do |update|
  33 + = render "repositories/feed", :update => update, :project => @project
32 34
app/views/team_members/show.html.haml
1 - allow_admin = can? current_user, :admin_project, @project 1 - allow_admin = can? current_user, :admin_project, @project
2 - user = @team_member.user 2 - user = @team_member.user
3 -%div  
4 - = link_to team_project_path(@project), :class => "btn right" do  
5 - Team »  
6 -  
7 - .media-grid  
8 - = link_to "#" do  
9 - = image_tag gravatar_icon(user.email, 90), :class => "thumbnail"  
10 - %h3.media_h= user.name  
11 - 3 +.media-grid
  4 + = link_to "#" do
  5 + = image_tag gravatar_icon(user.email, 60), :class => "thumbnail", :width => 60
  6 + %h3.media_h
  7 + = user.name
  8 + %br
  9 + %small= user.email
  10 +
  11 +.back_link
  12 + = link_to team_project_path(@project), :class => "" do
  13 + ← To team list
  14 +
  15 +%hr
12 %table.no-borders 16 %table.no-borders
13 %tr 17 %tr
14 %td Name 18 %td Name
@@ -23,7 +27,10 @@ @@ -23,7 +27,10 @@
23 %td= @team_member.created_at.stamp("Aug 21, 2011") 27 %td= @team_member.created_at.stamp("Aug 21, 2011")
24 28
25 %tr 29 %tr
26 - %td Project Access 30 + %td
  31 + Project Access
  32 + (#{link_to "read more", help_permissions_path, :class => "vlink"})
  33 +
27 %td 34 %td
28 = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f| 35 = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f|
29 = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin 36 = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, :class => "project-access-select", :disabled => !allow_admin
app/views/widgets/_project_member.html.haml
@@ -3,20 +3,31 @@ @@ -3,20 +3,31 @@
3 .media-grid 3 .media-grid
4 %li 4 %li
5 = link_to project_team_member_path(@project, member), :title => current_user.name do 5 = link_to project_team_member_path(@project, member), :title => current_user.name do
6 - = image_tag gravatar_icon(current_user.email, 90), :class => "thumbnail"  
7 - .row  
8 - .span4  
9 - %h4  
10 - = truncate(current_user.name, :lenght => 24)  
11 - - if @project.owner == current_user  
12 - %span.label Project Owner 6 + = image_tag gravatar_icon(current_user.email, 60), :class => "thumbnail", :width => 60
  7 + %h4
  8 + Hi,
  9 + = truncate current_user.first_name, :lenght => 24
  10 + !
  11 + %p
  12 + - if @project.issues_enabled
  13 + Assigned issues:
  14 + = current_user.assigned_issues.count
  15 + %br
  16 + - if @project.merge_requests_enabled
  17 + Assigned merge request:
  18 + = current_user.assigned_merge_requests.count
  19 + %br
  20 + Your merge requests:
  21 + = current_user.assigned_merge_requests.count
  22 + .link_holder
  23 + = link_to project_team_member_path(@project, member), :title => current_user.name do
  24 + = "Access: #{member.project_access_human} »"
13 25
14 - .span3  
15 - %span.label= member.project_access_human  
16 26
17 - - if can? current_user, :write_project, @project 27 +
  28 +-#- if can? current_user, :write_project, @project
  29 + .widget
18 - if @project.issues_enabled && @project.merge_requests_enabled 30 - if @project.issues_enabled && @project.merge_requests_enabled
19 - %hr  
20 .span3 31 .span3
21 %p You have access to create new issue or merge request. 32 %p You have access to create new issue or merge request.
22 %div 33 %div
app/views/widgets/_recent_projects.html.haml
@@ -7,4 +7,5 @@ @@ -7,4 +7,5 @@
7 %li 7 %li
8 = link_to project_path(project) do 8 = link_to project_path(project) do
9 = project.name 9 = project.name
10 - = link_to "More » ", projects_path 10 + .link_holder
  11 + = link_to "Projects » ", projects_path
spec/requests/snippets_spec.rb
@@ -21,7 +21,6 @@ describe "Snippets" do @@ -21,7 +21,6 @@ describe "Snippets" do
21 21
22 it { should have_content(@snippet.title[0..10]) } 22 it { should have_content(@snippet.title[0..10]) }
23 it { should have_content(@snippet.project.name) } 23 it { should have_content(@snippet.project.name) }
24 - it { should have_content(@snippet.author.name) }  
25 24
26 describe "Destroy" do 25 describe "Destroy" do
27 before do 26 before do