Commit 3e30b105910980967c4fc10808eeeee86acbe452

Authored by Dmitriy Zaporozhets
2 parents 5cf5c177 99fd58ce

Merge branch 'ui-improvements' into 'master'

Ui Improvements
app/assets/stylesheets/gl_bootstrap.scss
... ... @@ -108,6 +108,8 @@ $pagination-active-bg: $bg_style_color;
108 108  
109 109 // Nav tabs
110 110 .nav.nav-tabs {
  111 + margin-bottom: 15px;
  112 +
111 113 li {
112 114 > a {
113 115 padding: 8px 20px;
... ...
app/assets/stylesheets/sections/admin.scss
... ... @@ -2,7 +2,7 @@
2 2 * Admin area
3 3 *
4 4 */
5   -.admin_dash {
  5 +.admin-dashboard {
6 6 .data {
7 7 a {
8 8 h1 {
... ... @@ -14,6 +14,10 @@
14 14 }
15 15 }
16 16 }
  17 +
  18 + .str-truncated {
  19 + max-width: 60%;
  20 + }
17 21 }
18 22  
19 23 .admin-filter form {
... ...
app/assets/stylesheets/sections/dashboard.scss
... ... @@ -41,7 +41,7 @@
41 41 .dash-sidebar-tabs {
42 42 margin-bottom: 2px;
43 43 border: none;
44   - margin: 0;
  44 + margin: 0 !important;
45 45  
46 46 li {
47 47 &.active {
... ...
app/assets/stylesheets/sections/header.scss
... ... @@ -229,9 +229,9 @@ header {
229 229 }
230 230 .title {
231 231 a {
232   - color: #BBB;
  232 + color: #FFF;
233 233 &:hover {
234   - color: #FFF;
  234 + text-decoration: underline;
235 235 }
236 236 }
237 237 color: #fff;
... ...
app/assets/stylesheets/sections/merge_requests.scss
... ... @@ -31,10 +31,10 @@
31 31  
32 32 .mr_source_commit,
33 33 .mr_target_commit {
  34 + margin-top: 10px;
34 35 .commit {
35 36 margin: 0;
36   - padding: 0;
37   - padding: 5px 0;
  37 + padding: 2px 0;
38 38 list-style: none;
39 39 &:hover {
40 40 background: none;
... ...
app/assets/stylesheets/themes/ui_color.scss
... ... @@ -36,4 +36,8 @@
36 36 }
37 37 }
38 38 }
  39 +
  40 + .nav-pills > li.active > a, .nav-pills > li.active > a:hover, .nav-pills > li.active > a:focus {
  41 + background: #769;
  42 + }
39 43 }
... ...
app/models/merge_request.rb
... ... @@ -219,6 +219,14 @@ class MergeRequest < ActiveRecord::Base
219 219 end
220 220 end
221 221  
  222 + def source_project_namespace
  223 + if source_project && source_project.namespace
  224 + source_project.namespace.path
  225 + else
  226 + "(removed)"
  227 + end
  228 + end
  229 +
222 230 def source_branch_exists?
223 231 return false unless self.source_project
224 232  
... ...
app/views/admin/dashboard/index.html.haml
... ... @@ -3,136 +3,137 @@
3 3 %p.light
4 4 You can manage projects, users and other GitLab data from here.
5 5 %hr
6   -.admin_dash.row
7   - .col-sm-4
8   - .light-well
9   - %h4 Projects
10   - .data
11   - = link_to admin_projects_path do
12   - %h1= Project.count
13   - %hr
14   - = link_to 'New Project', new_project_path, class: "btn btn-new"
15   - .col-sm-4
16   - .light-well
17   - %h4 Users
18   - .data
19   - = link_to admin_users_path do
20   - %h1= User.count
21   - %hr
22   - = link_to 'New User', new_admin_user_path, class: "btn btn-new"
23   - .col-sm-4
24   - .light-well
25   - %h4 Groups
26   - .data
27   - = link_to admin_groups_path do
28   - %h1= Group.count
29   - %hr
30   - = link_to 'New Group', new_admin_group_path, class: "btn btn-new"
  6 +.admin-dashboard
  7 + .row
  8 + .col-sm-4
  9 + .light-well
  10 + %h4 Projects
  11 + .data
  12 + = link_to admin_projects_path do
  13 + %h1= Project.count
  14 + %hr
  15 + = link_to 'New Project', new_project_path, class: "btn btn-new"
  16 + .col-sm-4
  17 + .light-well
  18 + %h4 Users
  19 + .data
  20 + = link_to admin_users_path do
  21 + %h1= User.count
  22 + %hr
  23 + = link_to 'New User', new_admin_user_path, class: "btn btn-new"
  24 + .col-sm-4
  25 + .light-well
  26 + %h4 Groups
  27 + .data
  28 + = link_to admin_groups_path do
  29 + %h1= Group.count
  30 + %hr
  31 + = link_to 'New Group', new_admin_group_path, class: "btn btn-new"
31 32  
32   -.row.prepend-top-10
33   - .col-md-4
34   - %h4 Latest projects
35   - %hr
36   - - @projects.each do |project|
  33 + .row.prepend-top-10
  34 + .col-md-4
  35 + %h4 Latest projects
  36 + %hr
  37 + - @projects.each do |project|
  38 + %p
  39 + = link_to project.name_with_namespace, [:admin, project], class: 'str-truncated'
  40 + %span.light.pull-right
  41 + #{time_ago_with_tooltip(project.created_at)}
  42 +
  43 + .col-md-4
  44 + %h4 Latest users
  45 + %hr
  46 + - @users.each do |user|
  47 + %p
  48 + = link_to [:admin, user], class: 'str-truncated' do
  49 + = user.name
  50 + %span.light.pull-right
  51 + #{time_ago_with_tooltip(user.created_at)}
  52 +
  53 + .col-md-4
  54 + %h4 Latest groups
  55 + %hr
  56 + - @groups.each do |group|
  57 + %p
  58 + = link_to [:admin, group], class: 'str-truncated' do
  59 + = group.name
  60 + %span.light.pull-right
  61 + #{time_ago_with_tooltip(group.created_at)}
  62 +
  63 + %br
  64 + .row
  65 + .col-md-4
  66 + %h4 Stats
  67 + %hr
37 68 %p
38   - = link_to project.name_with_namespace, [:admin, project]
  69 + Forks
39 70 %span.light.pull-right
40   - #{time_ago_with_tooltip(project.created_at)}
41   -
42   - .col-md-4
43   - %h4 Latest users
44   - %hr
45   - - @users.each do |user|
  71 + = ForkedProjectLink.count
46 72 %p
47   - = link_to [:admin, user] do
48   - = user.name
  73 + Issues
49 74 %span.light.pull-right
50   - #{time_ago_with_tooltip(user.created_at)}
51   -
52   - .col-md-4
53   - %h4 Latest groups
54   - %hr
55   - - @groups.each do |group|
  75 + = Issue.count
56 76 %p
57   - = link_to [:admin, group] do
58   - = group.name
  77 + Merge Requests
59 78 %span.light.pull-right
60   - #{time_ago_with_tooltip(group.created_at)}
61   -
62   -%br
63   -.row
64   - .col-md-4
65   - %h4 Stats
66   - %hr
67   - %p
68   - Forks
69   - %span.light.pull-right
70   - = ForkedProjectLink.count
71   - %p
72   - Issues
73   - %span.light.pull-right
74   - = Issue.count
75   - %p
76   - Merge Requests
77   - %span.light.pull-right
78   - = MergeRequest.count
79   - %p
80   - Notes
81   - %span.light.pull-right
82   - = Note.count
83   - %p
84   - Snippets
85   - %span.light.pull-right
86   - = Snippet.count
87   - %p
88   - SSH Keys
89   - %span.light.pull-right
90   - = Key.count
91   - %p
92   - Milestones
93   - %span.light.pull-right
94   - = Milestone.count
95   - .col-md-4
96   - %h4
97   - Features
98   - %hr
99   - %p
100   - Sign up
101   - %span.light.pull-right
102   - = boolean_to_icon gitlab_config.signup_enabled
103   - %p
104   - LDAP
105   - %span.light.pull-right
106   - = boolean_to_icon Gitlab.config.ldap.enabled
107   - %p
108   - Gravatar
109   - %span.light.pull-right
110   - = boolean_to_icon Gitlab.config.gravatar.enabled
111   - %p
112   - OmniAuth
113   - %span.light.pull-right
114   - = boolean_to_icon Gitlab.config.omniauth.enabled
115   - .col-md-4
116   - %h4 Components
117   - %hr
118   - %p
119   - GitLab
120   - %span.pull-right
121   - = Gitlab::VERSION
122   - %p
123   - GitLab Shell
124   - %span.pull-right
125   - = Gitlab::Shell.new.version
126   - %p
127   - GitLab API
128   - %span.pull-right
129   - = API::API::version
130   - %p
131   - Ruby
132   - %span.pull-right
133   - #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
  79 + = MergeRequest.count
  80 + %p
  81 + Notes
  82 + %span.light.pull-right
  83 + = Note.count
  84 + %p
  85 + Snippets
  86 + %span.light.pull-right
  87 + = Snippet.count
  88 + %p
  89 + SSH Keys
  90 + %span.light.pull-right
  91 + = Key.count
  92 + %p
  93 + Milestones
  94 + %span.light.pull-right
  95 + = Milestone.count
  96 + .col-md-4
  97 + %h4
  98 + Features
  99 + %hr
  100 + %p
  101 + Sign up
  102 + %span.light.pull-right
  103 + = boolean_to_icon gitlab_config.signup_enabled
  104 + %p
  105 + LDAP
  106 + %span.light.pull-right
  107 + = boolean_to_icon Gitlab.config.ldap.enabled
  108 + %p
  109 + Gravatar
  110 + %span.light.pull-right
  111 + = boolean_to_icon Gitlab.config.gravatar.enabled
  112 + %p
  113 + OmniAuth
  114 + %span.light.pull-right
  115 + = boolean_to_icon Gitlab.config.omniauth.enabled
  116 + .col-md-4
  117 + %h4 Components
  118 + %hr
  119 + %p
  120 + GitLab
  121 + %span.pull-right
  122 + = Gitlab::VERSION
  123 + %p
  124 + GitLab Shell
  125 + %span.pull-right
  126 + = Gitlab::Shell.new.version
  127 + %p
  128 + GitLab API
  129 + %span.pull-right
  130 + = API::API::version
  131 + %p
  132 + Ruby
  133 + %span.pull-right
  134 + #{RUBY_VERSION}p#{RUBY_PATCHLEVEL}
134 135  
135   - %p
136   - Rails
137   - %span.pull-right
138   - #{Rails::VERSION::STRING}
  136 + %p
  137 + Rails
  138 + %span.pull-right
  139 + #{Rails::VERSION::STRING}
... ...
app/views/admin/groups/index.html.haml
1 1 %h3.page-title
2 2 Groups (#{@groups.total_count})
3   - %small
4   - allows you to keep projects organized.
5   - Use groups for uniting related projects.
6   -
7 3 = link_to 'New Group', new_admin_group_path, class: "btn btn-new pull-right"
8   -%br
  4 +
  5 +%p.light
  6 + Group allows you to keep projects organized.
  7 + Use groups for uniting related projects.
  8 +
  9 +%hr
9 10 = form_tag admin_groups_path, method: :get, class: 'form-inline' do
10 11 .form-group
11 12 = text_field_tag :name, params[:name], class: "form-control input-mn-300"
... ... @@ -23,24 +24,18 @@
23 24  
24 25 %h4
25 26 = link_to [:admin, group] do
  27 + %i.icon-folder-close
26 28 = group.name
27 29  
28 30 →
29 31 %span.monospace
30   - %i.icon-folder-close
31 32 %strong #{group.path}/
32   -
33   - .clearfix.light.append-bottom-10
34   - %span
35   - %b Members:
36   - %span.badge= group.members.size
37   - \|
38   - %span
39   - %b Projects:
40   - %span.badge= group.projects.count
41   -
42 33 .clearfix
43 34 %p
44 35 = truncate group.description, length: 150
  36 + .clearfix
  37 + %p.light
  38 + #{pluralize(group.members.size, 'member')}, #{pluralize(group.projects.count, 'project')}
  39 +
45 40  
46 41 = paginate @groups, theme: "gitlab"
... ...
app/views/admin/users/index.html.haml
1 1 .row
2 2 .col-md-3
3 3 .admin-filter
4   - = form_tag admin_users_path, method: :get, class: 'form-inline' do
5   - .append-bottom-10
6   - .form-group
7   - = search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'form-control'
8   - = button_tag type: 'submit', class: 'btn btn-primary' do
9   - %i.icon-search
10 4 %ul.nav.nav-pills.nav-stacked
11 5 %li{class: "#{'active' unless params[:filter]}"}
12 6 = link_to admin_users_path do
... ... @@ -25,6 +19,12 @@
25 19 Without projects
26 20 %small.pull-right= User.without_projects.count
27 21 %hr
  22 + = form_tag admin_users_path, method: :get, class: 'form-inline' do
  23 + .form-group
  24 + = search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'form-control'
  25 + = button_tag type: 'submit', class: 'btn btn-primary' do
  26 + %i.icon-search
  27 + %hr
28 28 = link_to 'Reset', admin_users_path, class: "btn btn-cancel"
29 29  
30 30 .col-md-9
... ...
app/views/devise/sessions/new.html.haml
1 1 .login-box
2 2 %h3.page-title Sign in
3 3 - if ldap_enabled?
4   - %ul.nav.nav-tabs.append-bottom-20
  4 + %ul.nav.nav-tabs
5 5 %li.active
6 6 = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab'
7 7 %li
... ...
app/views/profiles/emails/index.html.haml
1 1 %h3.page-title
2   - My Email Addresses
  2 + My email addresses
3 3 %p.light
4 4 Your
5 5 %b Primary Email
6   - will be used for account notifications, avatar detection and web based operations, such as edits and merges. All email addresses will be used to identify your commits.
  6 + will be used for account notifications, avatar detection and web based operations, such as edits and merges.
  7 + %br
  8 + All email addresses will be used to identify your commits.
  9 +
  10 +%hr
7 11  
8 12 .ui-box
9 13 .title
... ... @@ -19,11 +23,11 @@
19 23 added #{time_ago_with_tooltip(email.created_at)}
20 24 = link_to 'Remove', profile_email_path(email), data: { confirm: 'Are you sure?'}, method: :delete, class: 'btn btn-small btn-remove pull-right'
21 25  
22   -%h3.page-title Add Email Address
  26 +%h4 Add email address
23 27 = form_for 'email', url: profile_emails_path, html: { class: 'form-horizontal' } do |f|
24 28 .form-group
25 29 = f.label :email, class: 'control-label'
26 30 .col-sm-10
27 31 = f.text_field :email, class: 'form-control'
28 32 .form-actions
29   - = f.submit 'Add', class: 'btn btn-create'
30 33 \ No newline at end of file
  34 + = f.submit 'Add', class: 'btn btn-create'
... ...
app/views/projects/commits/_head.html.haml
1   -%ul.nav.nav-tabs.append-bottom-15
  1 +%ul.nav.nav-tabs
2 2 %li= render partial: 'shared/ref_switcher', locals: {destination: 'commits'}
3 3  
4 4 = nav_link(controller: [:commit, :commits]) do
... ...
app/views/projects/issues/_head.html.haml
1   -%ul.nav.nav-tabs.append-bottom-15
  1 +%ul.nav.nav-tabs
2 2 = nav_link(controller: :issues) do
3 3 = link_to project_issues_path(@project), class: "tab" do
4 4 Browse Issues
... ...
app/views/projects/merge_requests/_form.html.haml
... ... @@ -6,19 +6,22 @@
6 6 %li= msg
7 7  
8 8 .merge-request-branches
9   - .row
10   - .col-md-5
  9 + .form-group
  10 + = label_tag nil, class: 'control-label' do
  11 + From
  12 + .col-sm-10
11 13 .clearfix
12 14 .pull-left
13 15 = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? })
14 16 .pull-left
15 17  
16 18 = f.select(:source_branch, @merge_request.source_branches, { include_blank: "Select branch" }, {class: 'source_branch select2 span2'})
17   - .mr_source_commit.prepend-top-10
18   - .col-md-2
19   - .merge-request-angle
20   - %i.icon-long-arrow-right
21   - .col-md-5
  19 + .mr_source_commit
  20 + %br
  21 + .form-group
  22 + = label_tag nil, class: 'control-label' do
  23 + To
  24 + .col-sm-10
22 25 .clearfix
23 26 .pull-left
24 27 - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project]
... ... @@ -26,7 +29,7 @@
26 29 .pull-left
27 30  
28 31 = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2'})
29   - .mr_target_commit.prepend-top-10
  32 + .mr_target_commit
30 33  
31 34 %hr
32 35 .merge-request-form-info
... ...
app/views/projects/merge_requests/_merge_request.html.haml
... ... @@ -10,14 +10,14 @@
10 10 %span.pull-right
11 11 - if merge_request.for_fork?
12 12 %span.light
13   - = "#{merge_request.source_project_path}"
14   - = "#{merge_request.source_branch}"
  13 + #{merge_request.source_project_namespace}:
  14 + = merge_request.source_branch
15 15 %i.icon-angle-right.light
16   - = "#{merge_request.target_branch}"
  16 + = merge_request.target_branch
17 17 - else
18   - = "#{merge_request.source_branch}"
  18 + = merge_request.source_branch
19 19 %i.icon-angle-right.light
20   - = "#{merge_request.target_branch}"
  20 + = merge_request.target_branch
21 21 .merge-request-info
22 22 - if merge_request.author
23 23 authored by #{link_to_member(merge_request.source_project, merge_request.author)}
... ...
app/views/projects/merge_requests/_show.html.haml
... ... @@ -12,7 +12,7 @@
12 12 = render "projects/merge_requests/show/commits"
13 13  
14 14 - if @commits.present?
15   - %ul.nav.nav-tabs.append-bottom-10
  15 + %ul.nav.nav-tabs
16 16 %li.notes-tab{data: {action: 'notes'}}
17 17 = link_to project_merge_request_path(@project, @merge_request) do
18 18 %i.icon-comment
... ...
app/views/projects/merge_requests/branch_from.js.haml
1 1 :plain
2   - $(".mr_source_commit").html("#{commit_to_html(@commit, @source_project)}");
  2 + $(".mr_source_commit").html("#{commit_to_html(@commit, @source_project, false)}");
3 3 var mrTitle = $('#merge_request_title');
4 4  
5 5 if(mrTitle.val().length == 0) {
... ...
app/views/projects/merge_requests/branch_to.js.haml
1 1 :plain
2   - $(".mr_target_commit").html("#{commit_to_html(@commit, @target_project)}");
  2 + $(".mr_target_commit").html("#{commit_to_html(@commit, @target_project, false)}");
... ...
app/views/projects/milestones/show.html.haml
... ... @@ -48,7 +48,7 @@
48 48 = preserve do
49 49 = markdown @milestone.description
50 50  
51   -%ul.nav.nav-tabs.append-bottom-10
  51 +%ul.nav.nav-tabs
52 52 %li.active
53 53 = link_to '#tab-issues', 'data-toggle' => 'tab' do
54 54 Issues
... ...
app/views/projects/wikis/_nav.html.haml
1   -%ul.nav.nav-tabs.append-bottom-20
  1 +%ul.nav.nav-tabs
2 2 = nav_link(html_options: {class: params[:id] == 'home' ? 'active' : '' }) do
3 3 = link_to 'Home', project_wiki_path(@project, :home)
4 4  
... ...
app/views/search/_project_results.html.haml
1   -%ul.nav.nav-tabs.append-bottom-10
  1 +%ul.nav.nav-tabs
2 2 %li{class: ("active" if params[:search_code].present?)}
3 3 = link_to search_path(params.merge(search_code: true)) do
4 4 Repository Code
... ...