Commit 94db8a1c334b9ff5a0c28c89cb87ffa882095261

Authored by Dmitriy Zaporozhets
1 parent 9a24ccde

Usability & design improvements

app/assets/stylesheets/common.scss
... ... @@ -10,8 +10,12 @@ a {
10 10 color: $link_color !important;
11 11 }
12 12  
  13 +.pills a:hover {
  14 + background-color:#ccc;
  15 +}
  16 +
13 17 .pills .active a {
14   - background-color: #474D57;
  18 + background-color: #aaa;
15 19 }
16 20  
17 21 .label {
... ... @@ -83,7 +87,7 @@ a {
83 87 }
84 88  
85 89 .container .sidebar {
86   - width: 250px;
  90 + width: 220px;
87 91 height:100%;
88 92 min-height:450px;
89 93 float:right;
... ... @@ -131,6 +135,15 @@ nav.main_menu {
131 135 margin: 0;
132 136 float:left;
133 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 147 &.current {
135 148 background:#DDD;
136 149 }
... ... @@ -182,7 +195,7 @@ img.lil_av {
182 195 p { padding-top:5px; margin:0; color:$style_color;}
183 196 .author { color: #999; }
184 197 p {
185   - color:$style_color;
  198 + color:#222;
186 199 margin-bottom: 0;
187 200 img {
188 201 position:relative;
... ... @@ -230,6 +243,27 @@ img.lil_av {
230 243 .widget {
231 244 padding:20px;
232 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 276 margin:0;
243 277 }
244 278  
245   - h5 {
  279 + h5, .title {
246 280 padding: 0 10px;
247 281 background:#f5f5f5;
248 282 border-bottom: 1px solid #ccc;
249 283 @include round-borders-top(4px);
250 284 border-top:none;
  285 +
  286 + form {
  287 + padding-top:16px;
  288 + }
251 289 }
252 290  
253   - li {
  291 +
  292 + li, .wll {
254 293 padding:10px;
255 294 &:first-child {
256 295 @include round-borders-top(4px);
... ... @@ -266,3 +305,11 @@ img.lil_av {
266 305 }
267 306  
268 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 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 144 #tree-slider {
139 145 td {
140 146 padding:7px;
  147 + border-color:#f1f1f1;
141 148 }
142 149  
143 150 th {
... ...
app/controllers/merge_requests_controller.rb
... ... @@ -24,7 +24,9 @@ class MergeRequestsController < ApplicationController
24 24 @merge_requests = @project.merge_requests
25 25  
26 26 @merge_requests = case params[:f].to_i
  27 + when 1 then @merge_requests
27 28 when 2 then @merge_requests.closed
  29 + when 2 then @merge_requests.opened.assigned(current_user)
28 30 else @merge_requests.opened
29 31 end
30 32  
... ...
app/models/commit.rb
... ... @@ -42,7 +42,7 @@ class Commit
42 42 end
43 43  
44 44 def author_name
45   - author.name
  45 + author.name.force_encoding("UTF-8")
46 46 end
47 47  
48 48 def committer_name
... ...
app/models/user.rb
... ... @@ -65,7 +65,11 @@ class User < ActiveRecord::Base
65 65  
66 66 def self.generate_random_password
67 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 74 def self.find_for_ldap_auth(omniauth)
71 75 username = omniauth.sAMAccountName[0]
... ...
app/views/issues/_show.html.haml
... ... @@ -12,7 +12,7 @@
12 12 = image_tag gravatar_icon(issue.assignee_email), :class => "avatar"
13 13 %span.update-author
14 14 assigned to
15   - %strong= link_to_issue_assignee(issue)
  15 + %strong= issue.assignee_name
16 16 - if issue.critical
17 17 %span.label.important critical
18 18 - if issue.today?
... ...
app/views/issues/index.html.haml
... ... @@ -9,30 +9,30 @@
9 9 = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do
10 10 New Issue
11 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 36 %ul#issues-table.unstyled= render "issues"
37 37  
38 38 :javascript
... ...
app/views/issues/show.html.haml
... ... @@ -14,6 +14,11 @@
14 14 = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do
15 15 Edit
16 16  
  17 +.back_link
  18 + = link_to project_issues_path(@project) do
  19 + ← To issues list
  20 +
  21 +
17 22 %hr
18 23 - if @issue.closed
19 24 .alert-message.error Closed
... ...
app/views/keys/index.html.haml
... ... @@ -4,7 +4,7 @@
4 4  
5 5 %hr
6 6  
7   -%div#keys-table{ :class => "update-data ui-box ui-box-small ui-box-big" }
  7 +%div#keys-table
8 8 %ul.unstyled
9 9 - @keys.each do |key|
10 10 = render(:partial => 'show', :locals => {:key => key})
... ...
app/views/layouts/_project_menu.html.haml
1 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 3 Project
4 4  
5 5 - if @project.repo_exists?
... ...
app/views/layouts/_projects_side.html.haml
... ... @@ -4,16 +4,16 @@
4 4 You can create at least
5 5 = current_user.projects_limit
6 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 11 - if current_user.is_admin?
12 12 .widget
13 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 18 - if current_user.projects.count > 0
19 19 = render "widgets/recent_projects"
... ...
app/views/layouts/profile.html.haml
... ... @@ -10,7 +10,7 @@
10 10 = link_to "Password & token", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil
11 11 = link_to "Design", profile_design_path, :class => current_page?(:controller => "profile", :action => :design) ? "current" : nil
12 12 = link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do
13   - Keys
  13 + SSH Keys
14 14 .content
15 15 .row
16 16 .span12= yield
... ...
app/views/merge_requests/_merge_request.html.haml
1 1 %li.wll
2 2 = image_tag gravatar_icon(merge_request.author_email), :class => "avatar"
3 3 %span.update-author
4   - %strong= link_to_merge_request_author(merge_request)
  4 + %strong= merge_request.author_name
5 5 authored
6 6 = time_ago_in_words(merge_request.created_at)
7 7 ago
... ...
app/views/merge_requests/index.html.haml
... ... @@ -6,14 +6,21 @@
6 6  
7 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 19 = link_to edit_project_merge_request_path(@project, @merge_request), :class => "btn small" do
20 20 Edit
21 21  
  22 +.back_link
  23 + = link_to project_merge_requests_path(@project) do
  24 + ← To merge requests
22 25 %hr
23 26 - if @merge_request.closed
24 27 .alert-message.error Closed
... ...
app/views/projects/show.html.haml
1 1 = render "project_head"
2 2 %h3
3 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 9 %hr
5 10 .alert-message.block-message.warning
6 11 .input
... ... @@ -10,7 +15,8 @@
10 15  
11 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  
7 7  
8 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 19 .alert-message.block-message.warning
10 20 .input
11 21 .input-prepend
... ... @@ -13,20 +23,12 @@
13 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 1 - allow_admin = can? current_user, :admin_project, @project
2 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 16 %table.no-borders
13 17 %tr
14 18 %td Name
... ... @@ -23,7 +27,10 @@
23 27 %td= @team_member.created_at.stamp("Aug 21, 2011")
24 28  
25 29 %tr
26   - %td Project Access
  30 + %td
  31 + Project Access
  32 + (#{link_to "read more", help_permissions_path, :class => "vlink"})
  33 +
27 34 %td
28 35 = form_for(@team_member, :as => :team_member, :url => project_team_member_path(@project, @team_member)) do |f|
29 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 3 .media-grid
4 4 %li
5 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 30 - if @project.issues_enabled && @project.merge_requests_enabled
19   - %hr
20 31 .span3
21 32 %p You have access to create new issue or merge request.
22 33 %div
... ...
app/views/widgets/_recent_projects.html.haml
... ... @@ -7,4 +7,5 @@
7 7 %li
8 8 = link_to project_path(project) do
9 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 21  
22 22 it { should have_content(@snippet.title[0..10]) }
23 23 it { should have_content(@snippet.project.name) }
24   - it { should have_content(@snippet.author.name) }
25 24  
26 25 describe "Destroy" do
27 26 before do
... ...